Skip to content

Instantly share code, notes, and snippets.

@martinsik
martinsik / MyCalendar.h
Created March 8, 2013 09:47
Example of using EventKit on iOS 6+
#import <Foundation/Foundation.h>
@interface MyCalendar : NSObject
+ (void)requestAccess:(void (^)(BOOL granted, NSError *error))success;
+ (BOOL)addEventAt:(NSDate*)eventDate withTitle:(NSString*)title inLocation:(NSString*)location;
@end
@simonmichael
simonmichael / .bofi-checking.csv
Last active February 3, 2021 08:21
example hledger 0.20 csv reader rules for a two-amount-column csv file
Date Details Debit Credit Balance
07/12/2012 LODGMENT 529898 10.0 131.21
07/12/2012 PAYMENT 5 126
@padde
padde / openvpn.md
Last active June 6, 2025 21:03
OpenVPN on Ubuntu 12.10 at DigitalOcean

OpenVPN on Ubuntu 12.10 at DigitalOcean

Install OpenVPN

sudo apt-get install openvpn

Generate Server Certificates

sudo cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa2

cd /etc/openvpn/easy-rsa2

@jackdesert
jackdesert / gist:7090731
Last active December 26, 2015 04:09 — forked from hungpk/gist:5098340
This monkey patch of rails_admin allows me to set the timezone for rails_admin models explicitly, while the rest of the app runs on utc.
require 'rails_admin/config/fields/base'
module RailsAdmin
module Config
module Fields
module Types
class Datetime < RailsAdmin::Config::Fields::Base
def value
value_in_default_time_zone = bindings[:object].send(name)
@t-io
t-io / osx_install.sh
Last active January 5, 2026 06:12
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@krzysztofzablocki
krzysztofzablocki / gist:8913213
Last active January 25, 2018 22:06
Diet setup for cutting, paste into calca.io and modify stats.
# For training rest 5 min on compounds, 3-5 minutes on smaller ones
# Training A (first set to failure, second set -10% weight + 1 rep):
# Deadlift - 2x4-5
# Overhead Press - 1x6-8
# Weighted Chinup - 2x4-6
# Chest-Supported Rows - 2x6-8
# Close-grip chinup - 1x6-10
# Training B (first set to failure, second set -10% weight + 1 rep):
@debanjum
debanjum / Quote
Created March 5, 2014 06:23
Extracts Quotes from GoodReads. Stores text file in Variety compatible format
#!/bin/sh
# Initialising Variables [Enter You Use Name in place of USER]
quotesdir='/home/USER/.config/variety/pluginconfig/quotes/quotes.txt'
# New Quotes: Clean Earlier Quotes
[[ $# -eq 1 && $1 == 'New' ]] && ( `mv -f "$quotesdir" /tmp/quotes_old.txt` )
# Restore Earlier Quotes
[[ $# -eq 1 && $1 == 'Restore' ]] && ( `mv -f /tmp/quotes_old.txt "$quotesdir"` )
# Quote Help
@simonmichael
simonmichael / accounts.txt
Last active May 30, 2023 09:43
a sample *ledger chart of accounts (first 3 levels): combined personal & business, eg for a freelancer
assets
business
accounts receivable
bank
personal
accounts receivable
bank
cash
gifts
online
@staltz
staltz / introrx.md
Last active March 6, 2026 15:36
The introduction to Reactive Programming you've been missing
@keremk
keremk / Date.playground
Created June 24, 2014 06:56
Swift Date Helpers
// Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
enum TimeIntervalUnit {
case Seconds, Minutes, Hours, Days, Months, Years
func dateComponents(interval: Int) -> NSDateComponents {