Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
echo "[Gmail]/All Mail" > /tmp/archive_mail_plugin_config
archive_mail_plugin_config=`cat /tmp/archive_mail_plugin_config`
echo \'$archive_mail_plugin_config\' | xargs -0 defaults write com.apple.mail ArchiveMailboxName
rm /tmp/archive_mail_plugin_config
@bedhed
bedhed / shlog.sh
Created October 12, 2011 22:06 — forked from olbat/shlog.sh
shlog is a bash script that allow you to record a shell session by logging command history and giving diff of edited files
#!/bin/bash -e
####
# shlog is a bash script that allow you to record a shell session by logging
# command history and giving diff of edited files
####
# User notes:
# - Install:
# Load the script using 'source shlog.bash' (add it to your .bashrc
# to load it automatically)
@hugoduncan
hugoduncan / gist:2839891
Created May 31, 2012 00:41
OAuth with friend and oauthentic
(ns myapp.authenticate.oauth
"OAuth authentication"
(:require
[cheshire.core :as json]
[clj-http.client :as http]
[clojure.string :as string]
[clojure.tools.logging :as logging])
(:use
[oauthentic.core :only [build-authorization-url fetch-token]]
[ring.util.response :only [redirect]]
@dcarley
dcarley / gist:3811003
Created October 1, 2012 11:11 — forked from apsoto/gist:2869888
Diagram Showing EC2 Security Group Data Flows
#!/usr/bin/env ruby
require 'fog'
require 'graphviz'
ec2 = Fog::Compute.new(:provider => 'AWS')
graph = GraphViz::new("structs", "type" => "graph")
groups = ec2.security_groups
group_map = Hash[groups.collect { |g| [g.group_id, g.name] }]
@nitrogenlogic
nitrogenlogic / 00_posterous_import_moved.md
Last active October 23, 2016 00:43
This quick and dirty script imports posts and images exported by the Posterous backup feature into Octopress. Requires the escape_utils and nokogiri gems. Doesn't import comments.See comments below the gist for more instructions.
#! /usr/bin/env python3
# vim: set fileencoding=UTF-8
""" letsencrypt_dns_hook.py: Used as a hook script for dehydrated.sh during
validation for a given name to modify the route53 DNS records necessary to
provide proof of domain ownership.
"""
__author__ = "Zach Leslie"
__copyright__ = "Copyright 2016, OtoAnalytics"

Clojure is for Aristotelians

I was reading ["Clojure is for Type B Personalities"][2] and it sparked some thoughts I had about the intersection of western philosophy and programming.

One could say Mathematics is an extension of Epistemology. And all theory about computability are an extension of mathematics. I reckon how one thinks about computability and how one writes computable functions are a reflection of a person's natural epistemological tendencies. This is going to be just as unscientific as ["Clojure is for Type B Personalities"][2], but hopefully another

@seiyria
seiyria / Converter.js
Last active November 8, 2018 07:34
Docx -> MediaWiki w/ Images
var fs = require('fs-extra');
var wiki = require('nodemw');
var q = require('q');
var glob = require('glob');
var execSync = require('child_process').execSync;
var logger = require('winston');
var argv = require('minimist')(process.argv.slice(2));
var client = new wiki({
server: 'wiki.server.com',
@jasonroelofs
jasonroelofs / Timings.txt
Created November 29, 2012 18:23
Using Go for embarrassingly parallel scripts
] wc -l domains.txt
783 domains.txt
] time go run domain_lookup_parallel.go
real 0m5.743s
user 0m0.359s
sys 0m0.355s
] time go run domain_lookup_sequential.go