This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP DATABASE foo; | |
CREATE DATABASE foo; | |
GRANT ALL ON foo.* TO foo@localhost IDENTIFIED BY 'fooPassword'; | |
FLUSH PRIVILEGES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
url = require('url'); | |
var fqdnToRedirect = 'http://fqdn.tld'; | |
var server = http.createServer(function(req, res) { | |
var q = url.parse(req.url).path; | |
console.log('now redirect to '+q); | |
res.writeHead(302, { | |
'Location': fqdnToRedirect+q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netstat -ln -A inet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "20150115185533114" | |
var d = new Date(); | |
var date = ''+d.getFullYear()+('0'+(d.getMonth()+1)).substr(-2, 2)+('0'+(d.getDate())).substr(-2, 2)+d.getHours()+d.getMinutes()+d.getSeconds()+d.getMilliseconds(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* express could be installed globally (npm install -g) and loaded with global node_modules path set in NODE_PATH env | |
*/ | |
var express = require('express'); | |
var app = express(); | |
app.use(express.static(__dirname)); | |
app.listen(3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# installed node version 0.10 | |
# http://stackoverflow.com/questions/9044788/how-do-i-uninstall-nodejs-installed-from-pkg-mac-os-x | |
sudo npm uninstall npm -g | |
sudo rm -rf /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
sudo rm -rf /usr/local/include/node /Users/$USER/.npm | |
sudo rm /usr/local/bin/node | |
sudo rm /usr/local/share/man/man1/node.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://academy.appgyver.com/installwizard/steps#/install-nvm | |
# as regular user (not root) | |
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | sh | |
nvm install 0.10 | |
nvm use 0.10 | |
nvm alias default 0.10 | |
node -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The SPF record should be present as TXT to be able to be read by Mailgun, and optionnaly as SPF. | |
# To do that you need to edit the zone as "expert" cause Gandi IHM refuses to create a second TXT | |
# record for "@" (it can occurs if you have a Google Webmaster tool verification DNS record) | |
email 10800 IN CNAME mailgun.org. | |
krs._domainkey 10800 IN TXT "k=rsa; p=MIG...QAB" | |
@ 10800 IN SPF "v=spf1 include:mailgun.org ~all" | |
@ 10800 IN TXT "v=spf1 include:mailgun.org ~all" | |
@ 10800 IN TXT "google-site-verification=Gy0...xrY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var hitSchema = mongoose.Schema({ | |
text: String, | |
music: String | |
}); | |
hitSchema.statics.bulkInsert = function(models, fn) { | |
if (!models || !models.length) | |
return fn(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
#map { | |
height: 430px; | |
position: relative; | |
width: 100%; | |
} | |
.maps-frame { |
OlderNewer