Create a folder to store git hook templates
# ~/.gitconfig
[init]
templatedir = ~/.git_templates
The following files are in ~/.git_templates/hooks/
class CreatePost | |
# An interactor to create a post. | |
# Initialize with a request object that implements the request interface for this interactor. | |
def initialize(request) | |
RequestInterface.required_on! request | |
@user = {:title => request.title} | |
end | |
def result |
#!/usr/bin/env ruby | |
# <bitbar.title>Windfinder </bitbar.title> | |
# <bitbar.version>v1.0</bitbar.version> | |
# <bitbar.author>Gergő Sulymosi</bitbar.author> | |
# <bitbar.author.github>trekdemo</bitbar.author.github> | |
# <bitbar.desc>Show the 3 day forecast from Windfinder</bitbar.desc> | |
# <bitbar.image></bitbar.image> | |
# <bitbar.dependencies>ruby</bitbar.dependencies> | |
# <bitbar.abouturl></bitbar.abouturl> |
#!/bin/sh | |
# Put this file into your .git/hooks directory and make it | |
# executable. | |
# | |
# A hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook exits | |
# with non-zero status if the Rubocop check fails. | |
# Redirect output to stderr. | |
exec 1>&2 |
Create a folder to store git hook templates
# ~/.gitconfig
[init]
templatedir = ~/.git_templates
The following files are in ~/.git_templates/hooks/
require 'base64' | |
require 'uri' | |
require 'faraday' | |
module FaradayMiddleware | |
class BasicAuthOverwrite < Faraday::Middleware | |
KEY = "Authorization".freeze | |
def call(env) | |
rewrite_request(env) |
function cronitor { | |
if [ $# -ne 2 ]; then return; fi | |
if [ -z "$1" ]; then return; fi | |
if [ -z "$2" ]; then return; fi | |
echo "Sending signal to - https://cronitor.link/${2}/${1}" | |
curl "https://cronitor.link/${2}/${1}" -m 10 | |
} | |
# Usage |
This gist is just a placeholder for your solution of the Clojure Dojo from the Amsterdam Clojurians meetup.
To share your solution:
Thanks!
#!/usr/bin/env ruby | |
# This script creates LaunchBar snippets for kaomojis | |
# | |
# About kaomojis: http://www.gomotes.com/text-emoticons/ | |
# About LaunchBar snippets: https://blog.obdev.at/introducing-launchbar-snippets/ | |
# | |
# Run without `git checkout` | |
# | |
# ruby -e "$(curl -fsSL <RAW URL OF THIS GIST>)" | |
# |
# Usage: | |
# foo('Near the intersection of Lexington Ave and E 40th St') | |
# # => ['Lexington Ave', 'E 40th St'] | |
# foo('Between Lexington Ave and E 40th St') | |
# # => ['Lexington Ave', 'E 40th St'] | |
# | |
def foo(value) | |
case value | |
when (re = /^Near the intersection of (.*) and (.*)$/) | |
when (re = /^Between (.*) and (.*)$/) |
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list' | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 -y | |
sudo apt-get install postgresql-9.3-postgis pgadmin3 postgresql-contrib -y | |
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'" |