Skip to content

Instantly share code, notes, and snippets.

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"
@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){
@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
@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
@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'
@elliotbonneville
elliotbonneville / topkeywords.js
Last active August 23, 2022 10:26
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++;
@thibaut-sticky
thibaut-sticky / inputElementId.coffee
Last active August 29, 2015 14:06
WebdriverIO - useful commands
# Public : Base on the `label` and the `fieldset`, return the element id of the
# linked input.
#
# label - {String} Label of the input targeted.
# fieldset - {String} In case several label with the same value are visible,
# the fieldset can be provided to limit the research. (default: '').
#
# Returns
# an {Error}
# a {Number} which is the element id
@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
@JeffreyWay
JeffreyWay / .vimrc
Last active January 22, 2024 11:42
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: