Skip to content

Instantly share code, notes, and snippets.

View emdeeeks's full-sized avatar

Gareth Griffiths emdeeeks

View GitHub Profile
@emdeeeks
emdeeeks / post-receive
Created August 7, 2018 13:37 — forked from carlosantoniodasilva/post-receive
Basic git post-receive hook file to deploy a Rails app.
#!/bin/bash
APP_NAME="your-app-name-goes-here"
APP_PATH=/home/deploy/${APP_NAME}
# Production environment
export RAILS_ENV="production"
# This loads RVM into a shell session. Uncomment if you're using RVM system wide.
# [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm"
@emdeeeks
emdeeeks / api_blueprint.rb
Created July 20, 2018 19:07 — forked from nikone/api_blueprint.rb
Api Blueprint test docs
# lib/api_blueprint.rb
require 'rspec/core/formatters/base_formatter'
require 'pry'
class ApiBlueprintPrinter
def initialize(output)
@output = output
end
def print_meta_info
<?php
/* This file is hereby released to public domain */
require_once(__DIR__ . '/../lib/jsonRPCClient_bitcoin.php');
global $CONFIG;
$CONFIG = array(
'bitcoind_user' => 'change_this',
'bitcoind_pass' => 'change_this',
'bitcoind_port' => 'change_this',
'bitcoind_fee' => 0.0002, // Shoudl be enough for anybody
@emdeeeks
emdeeeks / simple_rdoc.rb
Created May 28, 2018 18:49 — forked from thehenster/simple_rdoc.rb
A very simple custom RDoc generator
# RDoc can use a custom generator but it isn't that well documentated. Here is a
# sample custom generator to get you going.
#
# Ruby comes with an `rdoc` executable but most of us generate our docs via Rake. To
# use your custom generator with Rake do something like the following in your Rakefile..
#
# require 'rdoc/task'
# require 'simple_rdoc'
#
# RDoc::Task.new('simple_doc') do |i|
@emdeeeks
emdeeeks / autoxm.py
Created April 22, 2018 11:34 — forked from DanielOaks/autoxm.py
autotracker.py, for generating XM chiptunes!
#!/usr/bin/env python3
# AutoXM
# written by Daniel Oaks <[email protected]>
# released into the public domain
# inspired by the public domain autotracker by Ben "GreaseMonkey" Russell
import struct, random
# XM Module Handling
#
@emdeeeks
emdeeeks / oauth.php
Created April 13, 2018 18:44 — forked from AstDerek/oauth.php
Some Oauth
<?php
class Google_OAuth {
var $client_id;
var $client_secret;
var $redirect_uri;
var $scopes = array(
'userinfo' => array(
@emdeeeks
emdeeeks / gendocs.py
Created April 2, 2018 23:06 — forked from dvirsky/gendocs.py
Generate Markdown documentation from a python package
# This script generates mkdocs friendly Markdown documentation from a python package.
# It is based on the the following blog post by Christian Medina
# https://medium.com/python-pandemonium/python-introspection-with-the-inspect-module-2c85d5aa5a48#.twcmlyack
import pydoc
import os, sys
module_header = "# Package {} Documentation\n"
class_header = "## Class {}"
function_header = "### {}"
@emdeeeks
emdeeeks / .custom-hooks pre-commit
Created April 1, 2018 00:39 — forked from Integralist/.custom-hooks pre-commit
[Python Auto Generate API Documentation] Python Auto Generate API Documentation #tags: python, git, bash, make
#!/bin/bash
set -e
err_report() {
echo "There was an issue with one of the pre-commit hooks"
echo ".git/hooks/pre-commit-*"
echo "Error on line $1"
}
trap 'err_report $LINENO' ERR
nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts',
'[Gmail]/Sent Mail': 'sent',
'[Gmail]/Starred': 'flagged',
'[Gmail]/Trash': 'trash',
'[Gmail]/All Mail': 'archive',
}.get(folder, folder)