Skip to content

Instantly share code, notes, and snippets.

View hparra's full-sized avatar

H. G. Parra hparra

View GitHub Profile
@kaleksandrov
kaleksandrov / global-protect.sh
Last active April 19, 2024 03:46
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active November 30, 2022 09:27
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@jimfleming
jimfleming / jsfmt-sublime.py
Created May 12, 2014 22:49
Very basic jsfmt integration for Sublime Text 3
import subprocess
import sublime, sublime_plugin
import os
PLUGIN_FOLDER = os.path.dirname(os.path.realpath(__file__))
SCRIPT_PATH = PLUGIN_FOLDER + '/node_modules/jsfmt/run.js'
NODE_PATH = '/usr/local/bin/node'
class FormatJavascript(sublime_plugin.TextCommand):
def run(self, edit):
@sindresorhus
sindresorhus / np.sh
Last active December 11, 2022 21:26
shell function for publishing node modules with some goodies
# npm publish with goodies
# prerequisite: `npm install -g trash`
# `np` with an optional argument `patch`/`minor`/`major`/`<version>`
# defaults to `patch`
np() {
trash node_modules &>/dev/null;
git pull --rebase &&
npm install &&
npm test &&
npm version ${1:-patch} &&
@joeLepper
joeLepper / gulpfile.js
Last active January 3, 2016 01:59
gulp-jade / gulp-rename weirdness
gulp.task('jade', function(){
gulp.src(['src/js/directives/**/jade/*.jade', 'src/jade/views/*.jade'])
.pipe(jade({ pretty : true }))
.pipe(rename(function(dir,base,ext){
var result = base + ext;
return result;
}))
.pipe(gulp.dest('./src/html'));
});
@jasonmccallister
jasonmccallister / db.php
Created October 26, 2013 20:23
My Craft db.php configuration for AppFog.com
<?php
/**
* Database Configuration
*
* All of your system's database configuration settings go in here.
* You can see a list of the default settings in craft/app/etc/config/defaults/db.php
*/
if ($_SERVER['HTTP_HOST'] == 'local.domainname.com') {
@psankar
psankar / gist:7098370
Last active December 26, 2015 05:09
Recommended Reading

An unsorted list of articles/books/programs that I (from my limited perspective) recommend for people who want to become a good computer science engineer. These materials are needed not just for the direct learning that they provide but also for getting a grasp of the good taste of these authors.

Books and Papers

@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@webdesserts
webdesserts / Gulpfile.js
Last active April 3, 2023 08:16
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
@lynaghk
lynaghk / 0-update.md
Last active July 5, 2022 13:33
Angular.js from ClojureScript