Skip to content

Instantly share code, notes, and snippets.

View unitof's full-sized avatar
◼️
no //

Jacob Ford unitof

◼️
no //
View GitHub Profile
#[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
eval "$(rbenv init -)"
alias json='python -mjson.tool | pygmentize -f terminal256 -l javascript -O style=native'
export NODE_PATH=/usr/local/lib/node_modules
@thadk
thadk / gist:6244053
Created August 15, 2013 19:37
Pinboard with Referrer Bookmarklet -This bookmarklet for pinboard.in adds the referring site (or twit-url) to the description when you bookmark
javascript:q=location.href;if(document.getSelection)%7Bd=document.getSelection()+" refrr:"+document.referrer;%7Delse%7Bd='';%7D;p=document.title;void(open('https://pinboard.in/add?showtags=yes&url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p),'Pinboard','toolbar=no,scrollbars=yes,width=750,height=700'));
@kohsuke
kohsuke / git-children-of
Created November 21, 2013 21:44
Given a commit, find immediate children of that commit.
#!/bin/bash -e
# given a commit, find immediate children of that commit.
for arg in "$@"; do
for commit in $(git rev-parse $arg^0); do
for child in $(git log --format='%H %P' --all | grep -F " $commit" | cut -f1 -d' '); do
git describe $child
done
done
done
@phatblat
phatblat / gist:0dd175b406cf2f3fbfc9
Created August 26, 2015 01:22
xcodebuild -exportOptionsPlist available keys (Xcode 7b6)
Available keys for -exportOptionsPlist:
compileBitcode : Bool
For non-App Store exports, should Xcode re-compile the app from bitcode? Defaults to YES.
embedOnDemandResourcesAssetPacksInBundle : Bool
For non-App Store exports, if the app uses On Demand Resources and this is YES, asset packs are embedded in the app bundle so that the app can be tested without a server to host asset packs. Defaults to YES unless onDemandResourcesAssetPacksBaseURL is specified.
@J2TEAM
J2TEAM / sublime-text-scopes.md
Last active January 17, 2024 22:44 — forked from iambibhas/scopes.txt
Sublime Text 2/3: Snippet scopes

Here is a list of scopes to use in Sublime Text 2/3 snippets -

ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
@davej
davej / transitionToPromise.js
Last active January 31, 2023 15:49
Do a CSS transition and resolve promise when complete
const transitionToPromise = (el, property, value) =>
new Promise(resolve => {
el.style[property] = value;
const transitionEnded = e => {
if (e.propertyName !== property) return;
el.removeEventListener('transitionend', transitionEnded);
resolve();
}
el.addEventListener('transitionend', transitionEnded);
});
@w0rd-driven
w0rd-driven / passwords.txt
Created November 18, 2016 20:19
BFG Repo-Cleaner --replace-text example
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default)
PASSWORD2==>examplePass # replace with 'examplePass' instead
PASSWORD3==> # replace with the empty string
regex:password=\w+==>password= # Replace, using a regex
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines
@michelmilezzi
michelmilezzi / idempotent_script.sql
Last active November 6, 2024 07:38
A simple script demonstrating PostgreSQL idempotent capabilities. You can run this script as many times as you wish (it will not give duplicate object error or similar).
--Table
CREATE TABLE IF NOT EXISTS person (
id integer NOT NULL,
person_name character varying(40) NOT NULL,
updated_date date,
CONSTRAINT person_pkey PRIMARY KEY (id)
);
--Index
CREATE INDEX IF NOT EXISTS idx_person_name ON person (person_name);
@anad-zeal
anad-zeal / index.html
Created August 29, 2018 00:31
Looping SVG text
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Camada_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500px" height="500px" x="0px" y="0px" viewBox="-220 280 171 233" style="enable-background:new -220 280 171 233;" xml:space="preserve">
<style type="text/css">
#raio{fill:none;stroke:none;}
</style>
<g>
<path id="raio" class="st0" d="M-156.3,491.4l4.3-86.6c0.2-3.4-2.6-6.3-6-6.3h-42.9c-1.9,0-3.3-1.7-2.9-3.6l18.6-97.5c0.3-1.4,1.5-2.4,2.9-2.4
l110.5-1.9c2,0,3.5,1.9,2.9,3.8l-23.8,88.4c-1,3.6,1.6,7.3,5.3,7.5l16.9,1.3c2.5,0.2,3.7,3.1,2,5l-82.6,94.5
C-152.9,495.6-156.4,494.2-156.3,491.4l4.3-86.6c0.2-3.4-2.6-6.3-6-6.3h-42.9c-1.9,0-3.3-1.7-2.9-3.6l18.6-97.5
c0.3-1.4,1.5-2.4,2.9-2.4l110.5-1.9c2,0,3.5,1.9,2.9,3.8l-23.8,88.4c-1,3.6,1.6,7.3,5.3,7.5l16.9,1.3c2.5,0.2,3.7,3.1,2,5
@adam-hanna
adam-hanna / systemd-cloudwatch-logs-tutorial.md
Last active November 6, 2024 08:17
Forward systemd service logs to AWS Cloudwatch

Introduction

I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.

Steps

Overall, it's a fairly simple process consisting of the following few steps.

1. Modify the service file

Open the service file with $ sudo vi /lib/systemd/system/{name}.service

Modify the [Service] section: