Skip to content

Instantly share code, notes, and snippets.

@elliotbonneville
elliotbonneville / topkeywords.js
Last active April 5, 2025 00:41
Find top keywords associated with a Google search with this Node.js application.
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
@tangerilli
tangerilli / rdio-migrate.py
Last active December 4, 2015 01:08
Lists the albums in your Rdio collection, and tries to find the same albums in Google Music and Spotify
import time
import getpass
import requests
from gmusicapi import Mobileclient
import spotipy
key = '3qetuttqnjhwfbv2usagog6cca'
secret = '2q0buOGtQNaNih7kyorJxA'
@maxparm
maxparm / pr-assessment.md
Last active October 18, 2016 18:37
Pull Request Assessment

Table to Predict Difficulty of a PR (yes = 1, no = 0)

  • Is it involving back-end and front-end? 1
  • Is it involving multiple models/apps? 1
  • Is a database schema change required? 1
  • How many ui screens are involved? N (as number of UI screens involved)
  • Is it involving changes on the mobile apps/extensions? N (as number of apps/extensions involved)
  • Is this a new feature? 1 (due to uncertainity)
  • Will a feature switch be used? 1
  • Does it involve old code (> 2 years old)? 1
  • Do we need to upgrade a library? 1
@josevalim
josevalim / watcher.sh
Last active May 22, 2024 10:06
A 1LOC bash script for re-running tests whenever a lib/ or test/ file changes keeping the same VM instance
# You will need fswatch installed (available in homebrew and friends)
# The command below will run tests and wait until fswatch writes something.
# The --stale flag will only run stale entries, it requires Elixir v1.3.
fswatch lib/ test/ | mix test --stale --listen-on-stdin
@laytong
laytong / complexityReducer.js
Created July 12, 2016 18:33
Remove complexity from redux reducers
const initialObjectivesState = {
aString: '',
};
/*
* As the number of actions increases, the cyclomatic complexity of the reducer will skyrocket
*/
const Reducer = function (state = initialObjectivesState, action) {
switch(action.type){
"UPDATE_STRING": function(state, action){
release-rc () {
rctag=$1
project=$2
# Validates tag name
regex='^[0-9]+\.[0-9]+\.[0-9]+'
if [[ ! $rctag =~ $regex ]]; then
echo "Tag version is not following the pattern"