Skip to content

Instantly share code, notes, and snippets.

View tblobaum's full-sized avatar
😆

Thomas J Blobaum tblobaum

😆
  • Creston, Iowa
View GitHub Profile
@creationix
creationix / .gitignore
Created April 15, 2010 16:13
Node Version Manager
HEAD
src
v*
@cyakimov
cyakimov / gist:1171968
Created August 25, 2011 21:09
Install NodeJS in CentOS / Fedora
yum groupinstall "Development Tools"
#get the lastest in nodejs.org
wget http://nodejs.org/dist/node-v0.4.11.tar.gz
tar xvzf node-v0.4.11.tar.gz
cd node-v0.4.11
./configure && make && make install
@3rd-Eden
3rd-Eden / core.js
Created November 5, 2011 18:56
custom script loader
(function (global) {
var _namespace = global.namespace
, namespace = {};
namespace.push = function push (fn) {
return fn && typeof fn === 'function' && fn(namespace);
};
if (_namespace && _namespace.length) {
var i = _namespace.length;
@indexzero
indexzero / opensource-guidelines.md
Created November 9, 2011 01:54
The least amount of guidelines possible to maintain 150+ open source node.js modules

Guidelines for Open Source at Nodejitsu

README.md Outline

  • Header
    • Brief description (should match package.json)
  • Example (if applicable)
  • Motivation (if applicable)
  • API Documentation: This will likely vary considerably from library to library.
  • Installation
@tj
tj / app.js
Created December 17, 2011 23:15
express 3.x cookie session middleware example
var express = require('express')
, cookieSessions = require('./cookie-sessions');
var app = express();
app.use(express.cookieParser('manny is cool'));
app.use(cookieSessions('sid'));
app.get('/', function(req, res){
req.session.count = req.session.count || 0;
var mongoose = require('./../../mongoose');
mongoose.connect('localhost', 'testing_tojsonWithVirtuals');
var schema = new mongoose.Schema({
name: {
first: String
, last: String
}
, age: Number
@bzerangue
bzerangue / html2md-with-pandoc.sh
Created April 26, 2012 23:14
RECURSIVELY Bash convert all your html to markdown files (with Pandoc)
find . -name "*.ht*" | while read i; do pandoc -f html -t markdown "$i" -o "${i%.*}.md"; done
@annalinneajohansson
annalinneajohansson / ajax.js
Last active December 31, 2023 05:50
Basic AJAX function in WordPress
jQuery(document).ready(function($){
var ajaxurl = object.ajaxurl;
var data = {
action: 'my_action', // wp_ajax_my_action / wp_ajax_nopriv_my_action in ajax.php. Can be named anything.
foobar: 'some value', // translates into $_POST['foobar'] in PHP
};
$.post(ajaxurl, data, function(response) {
alert("Server returned this:" + response);
});
});
@fhoffa
fhoffa / top_reddit_words.md
Last active September 1, 2021 20:08
The top 5 words for the top subreddits

The top 5 words for the top subreddits:

subr words
pics hell,minutes,hospital,build,backyard
funny soon,wanted,dads,photos,sums
videos better,change,plane,simple,curiosity
politics subject,democrat,democracy,basis,google
technology streaming,snowden,fast,edward,sued
@yakovsh
yakovsh / 2005_06_03-remove_vowels_from_hebrew.js
Last active May 23, 2022 19:43
Removing Vowels from Hebrew Unicode Text
/*
* One of the questions that recently came up is how to remove vowels from Hebrew characters in Unicode
* (or any other similar language). A quick look at Hebrew Unicode chart shows that the vowels are all
* located between 0x0591 (1425) and 0x05C7 (1479). With this and Javascript's charCodeAt function, it
* is trivial to strip them out with Javascript as follows
*
* Live demo is available here:
* https://jsfiddle.net/js0ge7gn/
*/