Skip to content

Instantly share code, notes, and snippets.

View nerdfiles's full-sized avatar
⚕️
bringing about the end-times of the philosophy

aha hah nerdfiles

⚕️
bringing about the end-times of the philosophy
View GitHub Profile
@nerdfiles
nerdfiles / .travis.yml
Created May 18, 2016 21:56 — forked from nmabhinandan/.travis.yml
Testing ES6 using Mocha by transpiling (using babel) into AMD(RequireJS) on PhantomJS.
language: node_js
node_js:
- '0.10'
- '0.11'
- '0.12'
- 'iojs-v1.7.1'
matrix:
allow_failures:

Creating a redis Module in 15 lines of code!

A quick guide to write a very very simple "ECHO" style module to redis and load it. It's not really useful of course, but the idea is to illustrate how little boilerplate it takes.

Step 1: open your favorite editor and write/paste the following code in a file called module.c

#include "redismodule.h"
/* ECHO <string> - Echo back a string sent from the client */
int EchoCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
@nerdfiles
nerdfiles / gist:25cd2d7b8d5716a50be948e4a0374945
Created April 15, 2016 03:54 — forked from honza/gist:2009499
Install Node.js via Chef
script "Install node.js" do
interpreter "bash"
code <<-EOH
sudo apt-get install python-software-properties -y;
sudo add-apt-repository ppa:chris-lea/node.js;
sudo apt-get update;
sudo apt-get install nodejs -y;
EOH
end
@nerdfiles
nerdfiles / nodejs.pp
Created April 15, 2016 03:52 — forked from badsyntax/nodejs.pp
Puppet: Installing node.js via nvm
class nodejs {
exec { 'nvm-install':
command => '/usr/bin/curl https://raw.github.com/creationix/nvm/master/install.sh | /bin/sh',
creates => '/home/vagrant/.nvm',
user => 'vagrant',
environment => 'HOME=/home/vagrant',
require => Package['curl']
}
@nerdfiles
nerdfiles / [email protected]
Created April 13, 2016 20:32 — forked from stouset/[email protected]
Generate a rainbow table of all possible SSNs

seq -f “%09.0f” 000000000 999999999 | sed -e ‘s/^\(.\{3\}\)\(.\{2\}\)\(.\{4\}\)/\1-\2-\3/’ | parallel -j16 –pipe ‘ruby -r digest/md5 -n -e “\$_.chomp!; puts "%s %s" % [\$_, Digest::MD5.hexdigest(\$_)]”’ > ssns

@nerdfiles
nerdfiles / gist:2d2b97414e02a56b9b27
Created March 28, 2016 16:39 — forked from bwhitman/gist:1041662
Echoprint song/identify query example
http://developer.echonest.com/api/v4/song/identify?api_key=N6E4NIOVYMTHNDM8J&code=eJy1mVuSZCkORLcEkgCxHF7a_xLmEPMxNmUWxEdZ9cMts4i4FySXu9OdUtKWHjDlBfsFOc0XmLzA0wv2E2I9QO5nvsMYL-D7D4j2AO3rAZb8Bfk8gBe8ILcX_FX39wN-dF_0BWO-4JQHSI4X6HlBkRfM9YJdH6Ac-wG3nF_B8nyB2gP-JTfyC1Z7wQ_m-AtqfsHsLzj2ANH9gjc3ur1g9AeoP6HPF6z6AEtPaPGAf8icH93vL9D6giov8P2Ct6rYeMG7-1ejv4KaPuBHB0u8wMcL-nnAr-6PF_yNbuz1gF_dfyqDnxf8O92o_QX_jDlvZdCQB1j2B1zTesA1pe_wN9w47QG5jRe8u_-e_Xus72D9BT98YT1AU31BXS_44QvtASmVF7w7eDf-HU59QL4b_w4_JnQ_QKq_4N2j-_iv8CPXvWdwzxdEfsCvDtoLfnRwvOBvOvjDf58dfE_Zu7_P3K63JN_hL9LX33TQrpF-gRkHQzvqq7fky_PYYy7lD4g508_Ke_H3iRRr2ZDWUxt1lSPcrFtva1ibSYTPe_Ex3QtOlWuT1CUV3-5mbdU81snbd6-lnai5yJZ8fIY3DR3ZoseM3UvfJrP2Heiwmo1Wp2WVJVaWsjubY-fI5Yy1Wi82Vs7Dy5giM00eZOxBHVdrkZcdSs8rXEvMms7yZn62n-ll0jKfyfcSlXN2EQxpxGyn8-3tKw7XaRULj1mGpS0zeqFK0c7Y1WduU8M6G0spmle-FUUXNVBV9-rK3nlo99xzC9rcVCoXsdLZWo_NptOxMndZ-ahx4s97_1hl5yO-rnqI5Cn8ARVtrffTOF_10HWblmN1duS7YeQnNT-lm68jlHzVuAXOW6XQEs6YecbsvR4_1jTL3qdNWRyljaalr7lXj7QnP9kOhQNSqD4H6oXP0J1GimVrIWW3rHoqXBla7fDcnj

http://www.ribbonfarm.com/2014/02/07/an-information-age-glossary/

Acting Dead

Pretending the world is less information-rich than it is. (Derived from Bruce Sterling)

Aestheticization

The process of creating a layer of superficial simplicity, harmony and normalcy as an aid to denial of underlying complexity, dissonance and strangeness.

@nerdfiles
nerdfiles / .ctags
Created January 4, 2016 22:19 — forked from jackcviers/.ctags
.ctags description for JavaScript and Coffeescript
--langdef=js
--langmap=js:.js
--regex-js=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\{/\1/,object/
--regex-js=/([A-Za-z0-9._$()]+)[ \t]*[:=][ \t]*function[ \t]*\(/\1/,function/
--regex-js=/function[ \t]+([A-Za-z0-9._$]+)[ \t]*\(([^)])\)/\1/,function/
--regex-js=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\[/\1/,array/
--regex-js=/([^= ]+)[ \t]*=[ \t]*[^"]'[^']*/\1/,string/
--regex-js=/([^= ]+)[ \t]*=[ \t]*[^']"[^"]*/\1/,string/
--langdef=coffee
--langmap=coffee:.coffee
@nerdfiles
nerdfiles / gist:3f90f6f282b8fcb0aa27
Created December 16, 2015 01:50
pyenv does not upgrade anything
foxmask@foxmask:~/.pyenv/versions/django-th-340$ pyenv virtualenv django-th-340 --help
Usage: pyenv virtualenv [-f|--force] [-u|--upgrade] [VIRTUALENV_OPTIONS] <version> <virtualenv-name>
pyenv virtualenv --version
pyenv virtualenv --help
-u/--upgrade Upgrade existing virtualenv to use new version of Python,
assuming Python has been upgraded in-place.
-f/--force Install even if the version appears to be installed already
foxmask@foxmask:~/.pyenv/versions/django-th-340$ python --version
@nerdfiles
nerdfiles / gist:28044c5f09180e42b53e
Created October 1, 2015 17:11 — forked from digitaljhelms/gist:1354003
Installing and using Gource on Mac OS X (only tested on Snow Leopard)

Gource

Gource is a software version control visualization tool.

Software projects are displayed by Gource as an animated tree with the root directory of the project at its centre. Directories appear as branches with files as leaves. Developers can be seen working on the tree at the times they contributed to the project.

http://code.google.com/p/gource/

Installing Gource Manually (w/out MacPorts or Homebrew)