This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// This precommit checks if certain staged files changed, and updates the version number of a correllating file, then `git add`s that file to be committed as well | |
// Useful for breaking caches like in WordPress which will serve the same CSS or JS if you forget to increment the version | |
// | |
// Example test usage after you added your program and regex match at the end of the `defaultArgs` (line 26) | |
// `git add assets/dist/community-directory.js` // A file correlating to `programs` (line 46) | |
// `node .git/hooks/precommit -s=true` // Will simulate a change | |
// `node .git/hooks/precommit -t=major` // Updates the version, increments the major value '1.5.5' => '1.6.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var start = 0; // starts from the first video | |
var end = 9; // deletes the first ten videos, set to -1 to remove all | |
var removeButtons = Array.prototype.slice.call(document.querySelectorAll('.pl-video .pl-video-edit-remove'), start, end); | |
// gathers all of the remove buttons and triggers a click event on all of the selected with a 250 ms interval | |
removeButtons.forEach(function (elem, index) { setTimeout(function () { console.log('removing index ' + index); elem.click() }, index * 250) }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var fs = require('fs'), | |
cs = require('coffee-script'), | |
os = require('os'), | |
glob = require('glob'), | |
beautify = require('js-beautify').js_beautify, | |
mkdirp = require('node-mkdirp'); | |
var path = require('path'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// If short | |
fnThatReturnsPromise('some val').catch(function () { | |
// handleError | |
}).then(functionThatLogsSomething) // Here we're assuming that there's no way this function can error out. If it can then do the next format | |
//// Or | |
// One pair | |
fnThatReturnsPromise('some val').catch(function () { | |
// handleError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
angular.module('uploadApp', [ | |
'flow' | |
'ngJcrop' | |
]).config [ | |
'flowFactoryProvider' | |
'ngJcropConfigProvider' | |
(flowFactoryProvider, ngJcropConfigProvider) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'Loading test_index mapping' | |
curl -XPUT localhost:9200/test_index -d '{ | |
"mappings":{ | |
"user":{ | |
"_id":{ | |
"path":"userID" | |
}, | |
"_routing":{ | |
"path":"userID" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Example aliases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
# | |
# rc.local | |
# | |
# This script is executed at the end of each multiuser runlevel. | |
# Make sure that the script will "exit 0" on success or any other | |
# value on error. | |
# | |
# In order to enable or disable this script just change the execution | |
# bits. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################### Elasticsearch Configuration Example ##################### | |
# This file contains an overview of various configuration settings, | |
# targeted at operations staff. Application developers should | |
# consult the guide at <http://elasticsearch.org/guide>. | |
# | |
# The installation procedure is covered at | |
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>. | |
# | |
# Elasticsearch comes with reasonable defaults for most settings, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NAME=elasticsearch | |
DIR=/opt/${NAME} | |
PID=/var/run/${NAME}.pid | |
if [ ! -f $PID ]; then | |
echo $$ > $PID | |
fi |
NewerOlder