Skip to content

Instantly share code, notes, and snippets.

View Bouhnosaure's full-sized avatar
🎺
Doot Doot !

Alex Bouhnosaure

🎺
Doot Doot !
View GitHub Profile
function scrollToAnchor(id){
var aTag = $("#"+id);
$('html,body').animate({scrollTop: aTag.offset().top - 50},'slow');
}
$( ".contact-form" ).on( "submit", function( event ) {
event.preventDefault();
$.ajax({
type: "POST",
url: $( this ).attr('action'),
data: $( this ).serialize(),
dataType: "json",
success: function(data) {
alert('tout est ok !');
},
#!/bin/bash
PID_FILE=/var/run/mailcatcher.pid
NAME=mailcatcher
PROG="/usr/bin/env mailcatcher"
USER=mailcatcher
GROUP=mailcatcher
start() {
echo -n "Starting MailCatcher"
@Bouhnosaure
Bouhnosaure / gist:8173f85ddd4b056282bf
Created May 15, 2015 00:22
Addind Mailcatcher to debian
first install
apt-get install ruby rubygems ruby-dev libsqlite3-dev
gem install mailcatcher
puis ajouter un script pour le lancer
https://gist.github.com/Bouhnosaure/49d733254d11d4240364
nano /etc/init.d/mailcatcher
ne pas oublier de changer les ip pour les faire correspondre a l'ip du server
int photocellPin = 0; // the cell and 10K pulldown are connected to a0
int photocellReading; // the analog reading from the analog resistor divider
void setup(void) {
// We'll send debugging information via the Serial monitor
Serial.begin(9600);
}
void loop(void) {
photocellReading = analogRead(photocellPin);
@Bouhnosaure
Bouhnosaure / index.js
Last active November 6, 2015 12:43
require node-restler et node-serialport
var serialport = require("serialport");
var SerialPort = serialport.SerialPort;
var sp = new SerialPort("/dev/ttyACM0", { baudrate: 9600, parser: serialport.parsers.readline("\n\r") }, false);
var rest = require('restler');
var callback = function (error) {
if ( error ) {
console.log('failed to open: '+error);
int photocellPin = A1;
int photocellReading;
const int sensorPin = 0;
const int hydroAnalog = A2;
void setup(void) {
Serial.begin(9600);
}
@Bouhnosaure
Bouhnosaure / brightmapreduce.js
Created May 25, 2015 20:44
couchdb map reduce brightness
//brightness : http://couchdb.ovh:5984/database/_design/mesures/_view/brightness?group=true
//map :
function(doc, req) {
var date = dateFromISO8601(doc.datetime);
emit(date.getDate(), doc.brightness);
function scrollToAnchor(id){
var aTag = $("#"+id);
$('html,body').animate({scrollTop: aTag.offset().top - 50},'slow');
}
PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'