Skip to content

Instantly share code, notes, and snippets.

@Watson1978
Watson1978 / AppDelegate.rb
Created Jul 26, 2012
MacRuby : Mountain Lion + Notification
View AppDelegate.rb
#
# AppDelegate.rb
# notify
#
# Created by watson on 2012/07/26.
#
module Notification
module_function
def send(title, text)
@Problematic
Problematic / install_pygit.sh
Created Feb 10, 2012
Installing pygit2 on Ubuntu 11.10
View install_pygit.sh
# this will install everything as root, so take that into account before you run it
# need cmake, python development headers, ZLib and OpenSSL
sudo apt-get install cmake python2.7-dev zlib1g-dev libssl-dev
mkdir libgit && cd libgit
git clone git://github.com/libgit2/libgit2.git
cd libgit2
@iloveitaly
iloveitaly / mysql2graffle.py
Created Dec 16, 2011
Visual Representation of MySQL Table in OmniGraffle
View mysql2graffle.py
#! /usr/bin/pythonw
#
# Modified by Michael Bianco <info@cliffsidedev.com> on June 26, 2009
# Written by Thomas Pan at January 21, 2007
# mysql2graffle for Omnigraffle 5 is based on
# MyDBGraffle for OmniGraffle 4 which is based on Paul Davis' work at http://www.visualdistortion.org
#
# Requires:
#
# OmniGraffle 5
@jonasrosland
jonasrosland / docker-swarm-data-persistence.md
Last active Aug 23, 2020
Use Docker Swarm with a data persistence layer
View docker-swarm-data-persistence.md

Use Docker Swarm with a data persistence layer

Create a Docker Swarm discovery token

curl -X POST https://discovery.hub.docker.com/v1/clusters
YOURSWARMTOKEN

Export the correct environment variables

@mkopit
mkopit / README.md
Last active Aug 25, 2020 — forked from jamesramsay/README.md
Gmail: delete old emails automatically
View README.md

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at https://script.google.com
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABEL_TO_DELETE: the label that should be have old messages deleted
@ndarville
ndarville / secret-key-gen.py
Created Aug 24, 2012
Generating a properly secure SECRET_KEY in Django
View secret-key-gen.py
"""
Two things are wrong with Django's default `SECRET_KEY` system:
1. It is not random but pseudo-random
2. It saves and displays the SECRET_KEY in `settings.py`
This snippet
1. uses `SystemRandom()` instead to generate a random key
2. saves a local `secret.txt`
@abeluck
abeluck / gpg-offline-master.md
Last active Apr 24, 2022 — forked from KenMacD/cmd.md
GPG Offline Master Key w/ smartcard
View gpg-offline-master.md
@nocturnalgeek
nocturnalgeek / MailinatorAliases
Last active May 30, 2022
A list of alternate domains that point to @mailinator.com
View MailinatorAliases
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@rothgar
rothgar / main.yml
Last active Jun 1, 2022
Generate /etc/hosts with Ansible
View main.yml
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@jamesramsay
jamesramsay / README.md
Last active Jun 12, 2022
Gmail: delete old emails automatically
View README.md

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at https://script.google.com
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABEL_TO_DELETE: the label that should be have old messages deleted