Skip to content

Instantly share code, notes, and snippets.

View bryanmaina's full-sized avatar

Bryan Maina bryanmaina

View GitHub Profile
import tweepy, simplejson, urllib, os,datetime,re
#----------------------------------------------------------------
def getBitlyKey():
bu='USER'
bkey='KEY'
return bu,bkey
def getTwapperkeeperKey():
key='KEY'
// Bonfire: Seek and Destroy
// Author: @kobibr
// Challenge: http://www.freecodecamp.com/challenges/bonfire-seek-and-destroy?solution=%2F*%20jshint%20esnext%3A%20true%20*%2F%0Afunction%20destroyer(arr)%20%7B%0A%20%20%27use%20strict%27%3B%0A%20%20var%20args%20%3D%20Array.prototype.slice.call(arguments)%3B%0A%20%20args.splice(0%2C1)%3B%0A%20%20for(let%20inR%20in%20arr)%20%7B%0A%20%20%20%20for(let%20inG%20in%20args)%20%7B%0A%20%20%20%20%20%20if(arr%5BinR%5D%20%3D%3D%20args%5BinG%5D)%7B%0A%20%20%20%20%20%20%20%20delete%20arr%5BinR%5D%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%0A%20%20function%20filterred%20(obj)%7B%0A%20%20%20%20return%20Boolean(obj)%3B%0A%20%20%7D%0A%20%20%0A%20%20var%20waitingRoom%20%3D%20arr.filter(filterred)%3B%0A%20%20return%20waitingRoom%3B%0A%7D%0A%0Adestroyer(%5B1%2C%202%2C%203%2C%201%2C%202%2C%203%5D%2C%202%2C%203)%3B%0A
// Learn to Code at Free Code Camp (www.freecodecamp.com)
/* jshint esnext: true */
function destroyer(arr) {
'use strict';
var args = Array
// Bonfire: Slasher Flick
// Author: @kobibr
// Challenge: http://www.freecodecamp.com/challenges/bonfire-slasher-flick?solution=function%20slasher(arr%2C%20howMany)%20%7B%0A%20%20return%20arr.splice(howMany-arr.length%2Carr.length-howMany)%3B%0A%7D%0A%0Aslasher(%5B1%2C%202%2C%203%5D%2C%202)%3B%0A
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function slasher(arr, howMany) {
return arr.splice(howMany-arr.length,arr.length-howMany);
}
slasher([1, 2, 3], 2);
@bryanmaina
bryanmaina / Gruntfile.js
Last active September 6, 2015 12:59 — forked from inkbase/Gruntfile.js
A Gruntfile to set up a Sass/Jade project
module.exports = function(grunt) {
// configure the tasks
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// copy from the source directory to build
copy: {
build: {