Skip to content

Instantly share code, notes, and snippets.

View roboflank's full-sized avatar
🍇

Denzel Wamburu roboflank

🍇
View GitHub Profile
@roboflank
roboflank / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@roboflank
roboflank / javascript_resources.md
Last active August 29, 2015 14:15 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@roboflank
roboflank / clicksendarduino.ino
Created October 29, 2015 12:51
Arduino code to receive sms from clicksend and display in LCD.
#include <Wire.h>
#include "rgb_lcd.h"
rgb_lcd lcd;
void setup()
{
Serial.begin(9600);
// set up the LCD's number of columns and rows:
@roboflank
roboflank / .js
Last active November 23, 2015 11:39
Install Nodejs in RaspberryPI
PATH="/opt/node/bin:$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/syno/bin:/usr/syno/sbin:/usr/local/bin:/usr/local/sbin"
@roboflank
roboflank / readme.md
Created February 21, 2016 15:34 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@roboflank
roboflank / mongoose-datequery
Created April 1, 2016 13:19
Query Data From Mongoose and Filter Depending on Date
myModel.find({
"date": {
'$gte': new Date('4/1/2016'),
'$lt': new Date('4/30/2016')
}
// will show data for the month of April
},
function(err, obj) {
if (err) return console.error(err);
console.log(obj);
@roboflank
roboflank / authfb.js
Created June 24, 2016 07:11
Firebase Authentication with facebook
var dataRef = new Firebase('https://<your-firebase>.firebaseio.com');
facebookConnectPlugin.login(['public_info'], function(status) {
facebookConnectPlugin.getAccessToken(function(token) {
// Authenticate with Facebook using an existing OAuth 2.0 access token
dataRef.authWithOAuthToken("facebook", token, function(error, authData) {
if (error) {
console.log('Firebase login failed!', error);
} else {
console.log('Authenticated successfully with payload:', authData);
@roboflank
roboflank / tmux-cheatsheet.markdown
Created August 14, 2016 06:35 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@roboflank
roboflank / momentjs.humanized.triplesplit.time.js
Created September 24, 2016 02:06 — forked from James1x0/momentjs.humanized.triplesplit.time.js
Get a humanized, "Morning", "Afternoon", "Evening" from moment.js **Great for user greetings!**
function getGreetingTime (m) {
var g = null; //return g
if(!m || !m.isValid()) { return; } //if we can't find a valid or filled moment, we return.
var split_afternoon = 12 //24hr time to split the afternoon
var split_evening = 17 //24hr time to split the evening
var currentHour = parseFloat(m.format("HH"));
if(currentHour >= split_afternoon && currentHour <= split_evening) {
@roboflank
roboflank / release.sh
Created October 1, 2016 08:34 — forked from edorgeville/release.sh
Creates a signed and zipaligned APK from your Ionic project
#!/bin/bash
#
# Creates a signed and zipaligned APK from your Ionic project
#
# Place your keystore in the root of your project and name it <company>.keystore
# Use this script as following :
# $ ./release.sh [company] [version]
#
# Don't forget to gitignore your key and your compiled apks.
#