Skip to content

Instantly share code, notes, and snippets.

View gavinengel's full-sized avatar

Gavin Engel gavinengel

View GitHub Profile
@gavinengel
gavinengel / tsv2csv.py
Last active January 27, 2017 17:10 — forked from nsonnad/tsv2csv.py
#!/usr/bin/env python
import sys
import csv
tabin = csv.reader(sys.stdin, dialect=csv.excel_tab)
commaout = csv.writer(sys.stdout, dialect=csv.excel)
for row in tabin:
commaout.writerow(row)
@gavinengel
gavinengel / sudoless-npm.sh
Last active April 30, 2016 22:36
sudoless-npm.sh
#!/bin/sh
# Place npm packages in your home folder without using sudo
# The lazy approach to installing cli npm programs requires sudo (root) access:
# $ sudo npm install -g somenpmpackage
# Of course, I do not recommend installing npm packages with sudo unless it's required.
# This is how I install CLI tools from npm without sudo:
# $ lib
# $ npm install --save somenpmpackage
@gavinengel
gavinengel / bashresults
Created January 2, 2015 19:24
feedback2-bindingjs
gavin@localhost:~/Desktop/bjs/bindingjs-0.9.1$ grunt --force
Running "jshint:grunt" (jshint) task
>> 10 files lint free.
Running "eslint:grunt" (eslint) task
Running "jsonlint:grunt" (jsonlint) task
>> 3 files lint free.
Running "mkdir:grunt" (mkdir) task
@gavinengel
gavinengel / feedback-bindingjs
Created January 2, 2015 18:09
for bindingjs
gavin@localhost:~/Desktop/bindingjs$ grunt
Running "jshint:grunt" (jshint) task
>> 10 files lint free.
Running "eslint:grunt" (eslint) task
Running "jsonlint:grunt" (jsonlint) task
>> 3 files lint free.
Running "mkdir:grunt" (mkdir) task
@gavinengel
gavinengel / openshift-mysql.sh
Created August 10, 2014 02:16
OpenShift MySQL CLI
#!/bin/sh
# connect to database for administration
mysql -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" ${OPENSHIFT_APP_NAME};
@gavinengel
gavinengel / openshift-daily-backup.php
Last active January 18, 2016 05:16
OpenShift/WordPress daily backup script
<?php
/**
* @author gavin@engel.com
* @version 2014-08-10-1254
* @homepage https://gist.github.com/gavinengel/2ca72704a3b30a07347a
*/
// Q: So, what is this php file?
// A: This helps you create both a files and a database dump backup every X days.
// (I don't trust WordPress backup plugins.)
// This is meant for OpenShift. Persistent folders in the "data" folder are backed up as well as repo "php/" files.
@gavinengel
gavinengel / magic-globals.js
Last active April 3, 2023 10:56
"Magic Globals" for node.js
// sets globals:
// __stack,
// __line,
// __file,
// __function,
// __ext,
// __base
// we already have these:
// __filename which gives as an example: /Users/mjr/example.js
@gavinengel
gavinengel / dabblet.css
Created November 14, 2013 20:58 — forked from chriscoyier/dabblet.css
Checkbox Hack
/* Checkbox Hack */
input[type=checkbox] {
display: none;
}
label {
display: inline-block;
margin: 60px 0 10px 0;
cursor: pointer;
}
@gavinengel
gavinengel / SassMeister-input.scss
Created November 12, 2013 19:56
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
@import "breakup";
$breakup-breakpoints: (
'thin' '(max-width: 35.999em)',
# I know it's an ugly, but it works for me. Complete installation process:
sudo apt-get update; sudo apt-get upgrade -y; sudo apt-get update;
sudo apt-get install -y python-software-properties python g++ make;
### 'add-apt-repository' not available on my Ubuntu 12.10 by default, so the next line adds it.
### more info found here: http://stackoverflow.com/questions/13018626/add-apt-repository-not-found
sudo apt-get install software-properties-common -y;
###