Skip to content

Instantly share code, notes, and snippets.

View m-r-m-s's full-sized avatar
🔈

mrms m-r-m-s

🔈
View GitHub Profile
@benatkin
benatkin / hello.js
Created April 24, 2011 08:16
http/https server with node + express + ufw
// I edited this using the ACE editor bookmarklet
// http://ajaxorg.github.com/ace/build/textarea/editor.html
var express = require('express'),
fs = require('fs');
var app = express.createServer({
key: fs.readFileSync('positive.key'),
cert: fs.readFileSync('positive.pem'),
ca: fs.readFileSync('positive-chain.crt')
});
@jamiew
jamiew / google_twunter_lol
Created July 28, 2011 20:34
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,
@lsauer
lsauer / fuzzy-search.sql
Last active December 7, 2023 23:58
FullText fuzzy searching in SQL / MySQL
#lo sauer, 2013 - www.lsauer.com
#see: http://www.lsauer.com/2013/05/mysql-fuzzy-searching-fulltext-queries.html
#Note: In MySQL SUBSTRING, the string-index starts at position 1
SELECT * FROM tablename
WHERE SOUNDEX(tablename_field)
LIKE CONCAT('%',SUBSTRING(SOUNDEX('Fuzti serch derm'),2),'%');
@rainyear
rainyear / countdown
Last active June 28, 2016 01:08
javascript countdown
// set the date we're counting down to
var target_date = new Date("Aug 15, 2019").getTime();
// variables for time units
var days, hours, minutes, seconds;
// get tag element
var countdown = document.getElementById("countdown");
// update the tag with id "countdown" every 1 second
@maddievision
maddievision / midiin.c
Created September 6, 2013 21:22
MIDI Input Logger (OS X)
//Andrew Lim 2013-09-07
//Compile with: -framework CoreMIDI -framework CoreFoundation -framework CoreAudio
#include <stdio.h>
#include <CoreMIDI/CoreMIDI.h>
const char * const NOTE_NAMES[] = {
"C","C#","D","D#","E","F","F#","G","G#","A","A#","B"
};
@hengkiardo
hengkiardo / gist:6491236
Created September 9, 2013 03:38
Download images with node.js
// npm install cheerio
// npm install request
function getImages(uri) {
var request = require('request');
var url = require('url');
var cheerio = require('cheerio');
path = require('path')
var fs = require('fs');
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@andrewmartin
andrewmartin / node-download.js
Created April 10, 2014 08:09
Download files with node.js
var fs = require('fs'),
stub = require('./stub'),
_ = require('underscore'),
request = require('request');
// config for local file
var basePath = "images/",
data = stub.data,
urlRoot = "http://cdn.catalogs.com/";
@ftrain
ftrain / actually.js
Last active November 10, 2023 01:16
A program that generates actuallies
/*
actually.js
_ _ _
__ _ __ _ __ _ __ _ ___| |_ _ _ __ _| | |_ _
/ _` |/ _` |/ _` |/ _` |/ __| __| | | |/ _` | | | | | |
| (_| | (_| | (_| | (_| | (__| |_| |_| | (_| | | | |_| |_
\__,_|\__,_|\__,_|\__,_|\___|\__|\__,_|\__,_|_|_|\__, ( )
|___/|/
*/
@jqn
jqn / string-incrementer.js
Created January 8, 2015 18:34
JS String Incrementer
/*
Your job is to write a function which increments a string, to create a new string.
If the string already ends with a number, the number should be incremented by 1.
If the string does not end with a number the number 1 should be appended to the new string.
Examples:
foo -> foo1
foobar23 -> foobar24