Skip to content

Instantly share code, notes, and snippets.

View adam-stokes's full-sized avatar
🦧

Adam Stokes adam-stokes

🦧
  • North Carolina
  • 02:05 (UTC -04:00)
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active October 31, 2025 20:47
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active August 25, 2025 12:52 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@mxswd
mxswd / md2cre.rb
Created July 22, 2012 07:20
Convert Markdown to Creole
#!/usr/bin/env ruby
# Invoke with `ruby md2cre.rb filename.md`
#
# Setup: `gem install redcarpet`
require 'rubygems'
require 'redcarpet'
class Creole < Redcarpet::Render::Base
def normal_text(text)
@davemo
davemo / api.proxy.server.js
Created November 6, 2012 21:56
A simple express.js server with a proxy that intercepts all requests with /api/ and proxies them to localhost:3000
var express = require('express'),
httpProxy = require('http-proxy'),
app = express();
var proxy = new httpProxy.RoutingProxy();
function apiProxy(host, port) {
return function(req, res, next) {
if(req.url.match(new RegExp('^\/api\/'))) {
proxy.proxyRequest(req, res, {host: host, port: port});
@thekuffs
thekuffs / 10gen.sls
Last active January 11, 2020 22:54
Salt: Add repos in Ubuntu
{% if grains['os'] == 'Ubuntu' %}
{% from "pkg_repo/apt.sls" import apt_repo with context %}
{% if pillar['pkg_mirrors_enabled'] %}
{% set mirrors = ['http://' + pillar['pkg_mirror'] + '/10gen/repo/upbuntu-upstart/',
'http://downloads-distro.mongodb.org/repo/ubuntu-upstart/'] %}
{% else %}
{% set mirrors = ['http://downloads-distro.mongodb.org/repo/ubuntu-upstart/'] %}
{% endif %}
{{ apt_repo('10gen', mirrors, codename='dist', components=['10gen'], key_id='7F0CEB10') }}
@siscia
siscia / morganmodelssocial.clj
Created November 30, 2012 17:35
Login with facebook in clojure
;;; MODELS
(ns morgan.models.social
(:require [clj-http.client :as client])
(:import [org.scribe.oauth OAuthService]
[org.scribe.builder ServiceBuilder]
[org.scribe.model Token Verifier OAuthRequest Verb])
(:import [org.scribe.builder.api FacebookApi TwitterApi]))
(def facebook-service
@mattmcc
mattmcc / models.py
Created March 27, 2013 00:24
Quick & dirty "read-only" model for using SQL views
class ViewManager(models.Manager):
def bulk_create(self, *args, **kwargs):
raise NotImplementedError
def create(self, *args, **kwargs):
raise NotImplementedError
def get_or_create(self, *args, **kwargs):
raise NotImplementedError
@syohex
syohex / cpanfile-highlight.el
Created April 15, 2013 13:54
highlight function for editing cpanfile
;; Coloring
(global-font-lock-mode t)
(defvar my/cpanfile-keywords
(rx (group (or "on"
"requires"
"recommends"
"suggests"
"conflicts"
"feature"
@balupton
balupton / README.md
Last active April 29, 2019 11:57
DocPad: Use DocPad, GitHub & Prose as a Wiki

Use DocPad, GitHub and Prose as a Wiki

This guide will walk you through how you can use a GitHub repository to house your wiki content, have DocPad render it, and automatically update on changes. It's also really nice as we get to benefit from the github project workflow for our wiki, that is issues, pull requests, etc.

We use this workflow heavily by linking the DocPad Website and the DocPad Documentation repositories allowing us to have users edit and submit pull requests for improvements to our documentation, and once merged, the website regenerates automatically.

1. Create a new repository for your Wiki Content

@tempire
tempire / gist:5621542
Last active December 17, 2015 13:59
Non-blocking request within a Mojolicious app
get '/' => sub {
my $self = shift;
my $ua = Mojo::UserAgent->new;
my $tx = $ua->build_tx(GET => 'http://tempi.re');
$tx->on(finish => sub {
my $tx = pop;
warn $tx->error; # premature connection close