Skip to content

Instantly share code, notes, and snippets.

💭
⚡️

Wamburu wamburu

💭
⚡️
Block or report user

Report or block wamburu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

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

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
@wamburu
wamburu / clicksendarduino.ino
Created Oct 29, 2015
Arduino code to receive sms from clicksend and display in LCD.
View clicksendarduino.ino
#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:
@wamburu
wamburu / .js
Last active Nov 23, 2015
Install Nodejs in RaspberryPI
View .js
PATH="/opt/node/bin:$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/syno/bin:/usr/syno/sbin:/usr/local/bin:/usr/local/sbin"
@wamburu
wamburu / readme.md
Created Feb 21, 2016 — forked from solderjs/readme.md
How to publish packages to NPM
View readme.md

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
@wamburu
wamburu / mongoose-datequery
Created Apr 1, 2016
Query Data From Mongoose and Filter Depending on Date
View mongoose-datequery
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);
@wamburu
wamburu / authfb.js
Created Jun 24, 2016
Firebase Authentication with facebook
View authfb.js
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);
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@wamburu
wamburu / momentjs.humanized.triplesplit.time.js
Created Sep 24, 2016 — forked from James1x0/momentjs.humanized.triplesplit.time.js
Get a humanized, "Morning", "Afternoon", "Evening" from moment.js **Great for user greetings!**
View momentjs.humanized.triplesplit.time.js
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) {
@wamburu
wamburu / release.sh
Created Oct 1, 2016 — forked from edorgeville/release.sh
Creates a signed and zipaligned APK from your Ionic project
View release.sh
#!/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.
#
You can’t perform that action at this time.