Skip to content

Instantly share code, notes, and snippets.

View devster's full-sized avatar

Jeremy Perret devster

View GitHub Profile
@devster
devster / php_setget.sublime-snippet
Last active August 29, 2015 13:55
PHP setter/getter snippet for sublime text
<snippet>
<content><![CDATA[
/**
* Set ${1:property}
*
* @param ${2:type} \$$1
*
* @return ${3:Type}
*/
public function set${1/^([a-z])/\u$1/g}(\$$1)
@devster
devster / gist:9545326
Created March 14, 2014 10:24
Install mscorefonts on debian wheezy
# Add this repo to the /etc/apt/source.list file
deb ftp://ftp.debian.org/debian stable contrib non-free
# And run these commands
sudo apt-get update
sudo apt-get install ttf-mscorefonts-installer
@devster
devster / gist:9888835
Created March 31, 2014 09:40
Trans unit xliff sublime text snippet
<snippet>
<content><![CDATA[
<trans-unit>
<source>${1:Source}</source>
<target>${2:Target}</target>
</trans-unit>
]]></content>
<tabTrigger>transunit</tabTrigger>
<scope>text.xliff</scope>
</snippet>
@devster
devster / gist:05acdc8c868479bc75ab
Created May 23, 2014 09:34
Base service deb template
#! /bin/bash
### BEGIN INIT INFO
# Provides: xvfbd
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: X Virtual Framebuffer
# Description: X Virtual Framebuffer
### END INIT INFO
@devster
devster / gist:24c0fc4ad93aeaf15562
Created May 26, 2014 08:02
mailcatcher ansible role
---
- name: install dependencies
apt: >
pkg={{ item }}
state=present
sudo: yes
with_items:
- libsqlite3-dev
- name: gem
var
path = require('path'),
_ = require('lodash'),
gulp = require('gulp'),
gulpUtil = require('gulp-util'),
log = gulpUtil.log,
colors = gulpUtil.colors,
glob = require('glob'),
fs = require('fs'),
gulpNotify = require('gulp-notify'),
#!/bin/sh
set -e
IP=`sudo docker inspect -f '{{ .NetworkSettings.IPAddress }}' ${1}`
HOST=$2
[ -z "$HOST" ] && exit 1;
sudo sed -i "s/.*\s${HOST}$/${IP} ${HOST}/" /etc/hosts
@devster
devster / file.io.sh
Last active February 15, 2024 17:15
Simple cli tool to use file.io https://www.file.io/#one Install: curl https://gist.githubusercontent.com/devster/e6a591879fd9c68b86c9/raw/87b826fdf20d1669fd99cbf5aa1f105e8a72a3a1/file.io.sh | sudo tee /usr/local/bin/file.io && sudo chmod +x /usr/local/bin/file.io
#!/bin/sh
URL="https://file.io"
DEFAULT_EXPIRE="14d" # Default to 14 days
if [ $# -eq 0 ]; then
echo "Usage: file.io FILE [EXPIRE]"
echo " Example: file.io path/to/my/file 1w"
echo " This example upload your file for 1 download and expires until 7 days if not downloaded."
echo "\nSee documentation at https://www.file.io/#one"
@devster
devster / release.sh
Created September 5, 2016 15:33
Relase git tag script
#!/bin/bash
# Script to simplify the release flow.
# 1) Fetch the current release version
# 2) Increase the version (major, minor, patch)
# 3) Add a new git tag
# 4) Push the tag
# Parse command line options.
while getopts ":Mmpd" Option
#!/usr/bin/env bash
apt-get update
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -