Skip to content

Instantly share code, notes, and snippets.

var $messages = $('.commit-message code a.message');
var version = $messages
.filter((i, mess) => mess.text.includes('Bump v'))
.text()
.split(' ')[1]
.match(/[\d|\.]/g)
.join('');
var sites = $messages
.filter((i, message) => message.innerText.includes('impossibleventures/'))
@chrisbodhi
chrisbodhi / snark-bot.js
Last active January 31, 2016 20:13
Prepping Botkit for deployment to Heroku
/*~~ Setup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
if (!process.env.token) {
console.log('Error: Specify token in environment');
process.exit(1);
}
const Botkit = require('../lib/Botkit.js');
const port = process.env.PORT || 3000;
const controller = Botkit.slackbot({
@chrisbodhi
chrisbodhi / gulp-shortcuts.sh
Created August 23, 2015 19:46
Bash scripts and shortcuts for my common Gulp tasks
# gulp-run.sh
#!/bin/sh
run() {
gulp run --url="$1"
}
run $1
# alias gru="~/.oh-my-zsh/custom/gulp-run.sh"
@chrisbodhi
chrisbodhi / closureTest.js
Created August 1, 2015 16:08
What will the value of `i` be in the alert box when `first()` and `tenth()` are called?
function makeGalaxy(size) {
var stars = [];
for (var i = 0; i < size; i++) {
stars.push(function(){alert("This is star #" + i);});
}
return stars;
};
var galaxy = makeGalaxy(20);
@chrisbodhi
chrisbodhi / palindrome.js
Last active August 29, 2015 14:26
Check to see if a string is a palindrome
var reverse = function(str) {
var ans = [],
arr = str.split('');
arr.forEach(function(chr) {
ans.unshift(chr);
});
return ans.join('');
};
var palindromeCheck = function(str) {
@chrisbodhi
chrisbodhi / reverse.js
Created August 1, 2015 15:59
Reverse a string
var reverse = function(str) {
var ans = [],
arr = str.split('');
arr.forEach(function(chr) {
ans.unshift(chr);
});
return ans.join('');
};
; #1
(define (sequence low high step)
(let ([next (+ low step)])
(if (>= high low)
(cons low (sequence next high step))
null)))
; #2
(define (string-append-map xs suffix)
(map (lambda (x)
var recruiters = document.getElementsByClassName('everyonelovesstackoverflow');
for (var i = recruiters.length - 1; 0 <= i; i--){
recruiters[i].remove();
}
for (var i = 0; recruiters.length > i; i++){
recruiters[i].remove();
}
// Block the ads for Stack Overflow careers, despite the
// fact it got me my last job
// #commentasconfession