Skip to content

Instantly share code, notes, and snippets.

@cdolek
cdolek / gist:b913c6936b1bd539d9f05ef1d9c2b9f6
Created May 31, 2017 23:26
Move first 1000 files in a folder to another folder
find . -maxdepth 1 -type f|head -1000|xargs -I{} mv {} ./targetDirectory
@cdolek
cdolek / gist:bc0b39e19f7788a84ad9eb7f8ea10c8d
Created April 7, 2017 17:41 — forked from nilesolutions/gist:d1baa681afcfe14b7e24c23616f9147c
OS X 10.10 Yosemite Local Development Environment: Apache, PHP, and MySQL with Homebrew
Homebrew Setup
If you've not already installed Homebrew, you can follow the instructions at http://brew.sh. I used to include the command in previous walkthrough blogs, but it could change after posting, so definitely check their website to install it properly.
If you do not have git available on your system, either from Homebrew, Xcode, or another source, you can install it with Homebrew now (if you already have it installed, feel free to skip this step to keep the version of git you already have):
brew install -v git
PATH Variable
In previous guides on 10.9 and earlier, I added a change to $PATH in ~/.bash_profile to ensure that Homebrew-installed applications would run by default over similar ones that were already installed on OS X. Thankfully, Yosemite's $PATH order is different than earlier OS versions and now includes the default Homebrew location of /usr/local/bin in front. If you installed Homebrew to a custom location, or are not seeing /usr/local/bin at the beginning of your shell's $PATH, chec
@cdolek
cdolek / gist:41ec1ca8c41ba797ec12b88c37718612
Created December 22, 2016 13:37 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@cdolek
cdolek / mongo-dump-csv.sh
Created December 17, 2016 17:23 — forked from mderazon/mongo-dump-csv.sh
Export all of Mongodb collections as csv without the need to specify fields
OIFS=$IFS;
IFS=",";
# fill in your details here
dbname=DBNAME
user=USERNAME
pass=PASSWORD
host=HOSTNAME:PORT
# first get all collections in the database
@cdolek
cdolek / gist:1eaaf2d66e6b10230348e5db8b7fb60b
Last active October 27, 2016 15:47
Installing MySQL 5.6 on Debian Jessie
http://www.debiantutorials.com/install-mysql-server-5-6-debian-7-8/
# check if newer exists at: http://dev.mysql.com/downloads/repo/apt/
wget http://dev.mysql.com/get/mysql-apt-config_0.8.0-1_all.deb
dpkg -i mysql-apt-config_0.8.0-1_all.deb
ufw default deny incoming
ufw default deny outgoing
ufw limit ssh
ufw allow svn
ufw allow git
ufw allow out http
ufw allow in http
ufw allow out https
ufw allow in https
ufw allow out 53
@cdolek
cdolek / .bash_profile
Created May 21, 2016 08:35
starter bash_profile
#############################################################################
export PS1='\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
umask 022
#############################################################################
eval "`dircolors`"
#############################################################################
http {
proxy_cache_path /tmp/nginx/cache
levels=1:2
keys_zone=main:10m
max_size=1g inactive=1d;
proxy_temp_path /tmp/nginx/tmp;
server {
listen 80;
server_name app.example.com;
@cdolek
cdolek / female.json
Created May 11, 2016 20:42
Mock User Data - 300 Male + 300 Female with IDS
[{"ID":"KAPH-2850-SVGO-4049","name":"Alexandra","familyName":"Heroux","gender":"F","birthDate":"1982-11-29T08:14:47Z"},
{"ID":"GKCB-5524-ADUB-5290","name":"Julianna","familyName":"Jacoby","gender":"F","birthDate":"1984-09-08T15:46:48Z"},
{"ID":"FKRC-2692-GJNY-6792","name":"Shoshana","familyName":"Juel","gender":"F","birthDate":"1975-07-15T10:08:39Z"},
{"ID":"CGIM-0373-DWNU-4445","name":"Ivey","familyName":"Stainbrook","gender":"F","birthDate":"1996-02-13T16:54:53Z"},
{"ID":"IOPV-9298-MZHB-9361","name":"Mariko","familyName":"Fishburn","gender":"F","birthDate":"1973-10-17T23:35:53Z"},
{"ID":"GPES-8736-WGKT-5994","name":"Le","familyName":"Broadway","gender":"F","birthDate":"1971-01-02T17:04:05Z"},
{"ID":"LPDB-2346-JWOH-6291","name":"Era","familyName":"Graybill","gender":"F","birthDate":"1988-11-09T11:16:07Z"},
{"ID":"LUHV-4847-MLGA-1906","name":"Aleen","familyName":"Abrahams","gender":"F","birthDate":"1994-06-12T08:43:37Z"},
{"ID":"LOXJ-0459-NYRP-1889","name":"Merri","familyName":"Masterson","gender":"F","birthD
@cdolek
cdolek / gist:71fecaa252a5672c923e
Created October 19, 2015 03:40
Google Spreadsheet Script
function findDateFromCalendarByName( find , timer ){
if ( find == '' ) { return; }
var ss = SpreadsheetApp.getActiveSpreadsheet(), output = [];
// var searchData = ss.getSheetByName('Calendar').getDataRange().getValues();
var searchData = ss.getSheetByName('Calendar').getRange("A1:P10").getValues();
for(var j=0, jLen=searchData.length; j<jLen; j++) {