Skip to content

Instantly share code, notes, and snippets.

View exalted's full-sized avatar
🏠
Working from home

Ali Servet Donmez exalted

🏠
Working from home
View GitHub Profile
@exalted
exalted / gist:726910
Created December 3, 2010 12:42
This will convert DateTime (.NET) object serialized as JSON by WCF to a NSDate object
/*
* This will convert DateTime (.NET) object serialized as JSON by WCF to a NSDate object.
*/
// Input string is something like: "/Date(1292851800000+0100)/" where
// 1292851800000 is milliseconds since 1970 and +0100 is the timezone
NSString *inputString = [item objectForKey:@"DateTimeSession"];
// This will tell number of seconds to add according to your default timezone
// Note: if you don't care about timezone changes, just delete/comment it out
@exalted
exalted / NSString+Punctuation.h
Created December 10, 2010 00:50
String capitalization for NSString while keeping roman numerals all capitalized.
//
// NSString+Punctuation.h
// by Ali Servet Donmez <asd NOSPAM pittle.org>, 2010
// http://www.pittle.org/
//
/*
* Requirements
* ------------
* - "RegexKitLite" (http://regexkit.sourceforge.net/#RegexKitLite)
@exalted
exalted / update-translations.py
Last active October 13, 2015 03:08
Update by merging .strings file(s) of an Xcode project. Probably similar to, but much better — obviously: * https://github.com/ndfred/xcode-tools/blob/master/update_strings.py * https://github.com/dulaccc/pygenstrings
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""Update by merging .strings file(s) of an Xcode project."""
import os
import sys
import shlex
import shutil
import tempfile
@exalted
exalted / autobot.sh
Last active December 16, 2015 07:19
Automagically create, setup and deploy Hubot on Heroku with Campfire adapter!
#!/usr/bin/env bash
#
# Autobot: create, setup and deploy Hubot on Heroku with Campfire adapter.
#
# USAGE:
# autobot.sh <path>
#
# Autobot will;
# 1. download and install all the Hubot machinery
# 2. create your very own Hubot instance

GitHub Secrets

URL Features

/commits

/<ref> (ref: SHA or branch)

Pod::Spec.new do |s|
s.name = 'Nimbus'
s.version = '0.9.3-arc-ios7'
s.license = 'Apache License, Version 2.0'
s.summary = 'An iOS framework whose growth is bounded by O(documentation).'
s.homepage = 'http://docs.nimbuskit.info/index.html'
s.author = { 'Jeff Verkoeyen' => 'jverkoey@gmail.com',
'Bubnov Slavik' => 'bubnovslavik@gmail.com',
'Roger Chapman' => 'rogchap@gmail.com',
'Manu Cornet' => 'manu.cornet@gmail.com',
@exalted
exalted / create-git-repo-from-subdirectory.sh
Last active July 9, 2018 02:02
Given a subdirectory extract separate repo out of an existing one
# Simple
git filter-branch --prune-empty --subdirectory-filter foobar/ --tag-name-filter cat -- --all
# Complex
# (Ref.: http://stackoverflow.com/a/17867910/11895,
# http://stackoverflow.com/a/19957874/11895)
git filter-branch -f --prune-empty --index-filter \
'git rm --cached --ignore-unmatch -r -q -- . ; \
git reset -q $GIT_COMMIT -- .gitignore README.md foo/ bar/' \
-- --all
@exalted
exalted / sql-cheatsheet.txt
Last active July 9, 2018 02:02
SQL Cheatsheet
+--------------------------------------------------------------------+
| |
| SELECT * |
| FROM A |
| [INNER] JOIN B ON A."FOO" = B."BAR" [AND ...]; |
| |
+--------------------------------------------------------------------+
| |
| SELECT * |
| FROM A |
@exalted
exalted / create-ssh-key.md
Last active December 2, 2022 08:37
Create SSH key (Heroku)

Create SSH key

It's best having separate keys on different workstations (e.g., home, office, etc.).

Generate a public key:

ssh-keygen -t rsa -f ~/.ssh/heroku_rsa -C"$(whoami)@$(hostname)"`
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "double",