Skip to content

Instantly share code, notes, and snippets.

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 9, 2024 20:00
Hyperlinks in Terminal Emulators
Vex is a minimalistic markup language with the motto "form without meaning".
This is going to @italic=really hurt.
// @author: Per Vognsen
// @version: 1.3
The weather forecast for @date is @weather.
@list{
@sanketsaurav
sanketsaurav / git-semver.sh
Created September 24, 2015 07:09
SemVer for Git implemented as pre-commit hook
#!/bin/bash
# Allows us to read user input below, assigns STDIN to keyboard
exec < /dev/tty
git rev-parse --show-toplevel | cd
file="VERSION"
if [ -f "$file" ]
then
# Copyright (c) 2014 yuzurihara. All rights reserved.
# Released under the BSD 3-Clause License.
# http://opensource.org/licenses/BSD-3-Clause
import os
import sys
import subprocess
import atexit
@hanshuebner
hanshuebner / rc.local
Created March 28, 2014 09:19
my tmux start stuff
#!/bin/sh
su hans -c '/home/hans/bin/start-tmux.sh'
@dixson3
dixson3 / workspace.sh
Created January 10, 2014 19:11
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
@lsaffie
lsaffie / tmux18-ubuntu-10-04
Last active December 21, 2015 16:49
Install tmux1.8 in Ubuntu 10.04
#author: Luis Saffie <luis@saffie.ca>
#url: www.saffie.ca
#twitter: lsaffie
#
#tmux1.8 has some great features. One of them is pane zooming..
#http://blog.sanctum.geek.nz/zooming-tmux-panes/
#however, tmux 1.8 depends on libevent2 which does not come with 10.04
#solution: build from scratch!
#NOTE: LDFLAGS is used to build tmux because for some reason it can't find the ld_libs from libevent2.. Everything done by this script is legit thought...
#USAGE: wget -O - https://gist.github.com/lsaffie/6335957/raw/tmux18-ubuntu-10-04 |bash
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@drautb
drautb / CMake: Variable Dump
Created July 3, 2013 20:11
This snippet will dump all CMake variables to the build output
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
@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.