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 / 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

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 / .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:
@nerdfiles
nerdfiles / bash-cheatsheet.sh
Created January 20, 2017 16:30 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@nerdfiles
nerdfiles / mixpanel-cheatsheet.js
Created January 20, 2017 16:31 — forked from LeCoupa/mixpanel-cheatsheet.js
Mixpanel Library CheatSheet
// Mixpanel Cheatsheet
// This requires the mixpanel javascript library to be embedded on your site
// https://mixpanel.com/help/reference/javascript-full-api-reference
// 1. API Methods.
mixpanel.init('new token', { your: 'config' }, 'library_name'); // initialize a new instance of the Mixpanel tracking object
mixpanel.push(['register', { a: 'b' }]); // push() keeps the standard async-array-push behavior around after the lib is loaded. This is only useful for external integrations that do not wish to rely on our convenience methods (created in the snippet).
@nerdfiles
nerdfiles / optimizely-js-api-cheatsheet.js
Created January 20, 2017 16:42 — forked from LeCoupa/optimizely-js-api-cheatsheet.js
Optimizely Javascript API Cheatsheet
// Optimizely JavaScript API
// http://developers.optimizely.com/javascript/
// To opt a visitor out of Optimizely tracking
// http://www.example.com/page.html?optimizely_opt_out=true
// 1. API Function Calls
// http://developers.optimizely.com/javascript/#api-function-calls-2
// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
define(['services/module', 'underscore'], function (module, _) {
'use strict';
function OrderResource($http, $q, link) {
// ... other functions removed: viewState, accessState, flattenResource
// viewState is a deeper resource
// accessState looks at the Accept headers
// flattenResource: flattens all of this for the client-side resource (in-memory model bound to view)
@nerdfiles
nerdfiles / Microservices.md
Last active March 21, 2017 16:58 — forked from Integralist/Microservices.md
Microservices

In Summary:

  • Microservices are small autonomous services
  • Microservices are modeled around business concepts
  • Microservices encourage a culture of automation
  • Microservices should be highly observable
  • Microservices should hide implementation details
  • Microservices should isolate failure
  • Microservices should be deployed independently
  • Microservices should decentralise all the things
@nerdfiles
nerdfiles / namespaces.tsv
Created January 22, 2017 23:14 — forked from miku/namespaces.tsv
Namespace prefix according to prefix.cc
aair http://xmlns.notu.be/aair#
aapi http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#
aat http://vocab.getty.edu/aat/
abc http://www.metadata.net/harmony/ABCSchemaV5Commented.rdf#
ac http://umbel.org/umbel/ac/
acc http://purl.org/NET/acc#
acco http://purl.org/acco/ns#
acl http://www.w3.org/ns/auth/acl#
acm http://www.rkbexplorer.com/ontologies/acm#
act http://www.w3.org/2007/rif-builtin-action#