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)
@jehiah
jehiah / git-branch-status
Last active March 21, 2024 12:39
show git ahead/behind info for branches
moved to github --> https://github.com/bill-auger/git-branch-status/
@IanVaughan
IanVaughan / uninstall_gems.sh
Created June 9, 2012 20:37
Uninstall all rbenv gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
@roberto
roberto / _flash_messages.html.erb
Created August 13, 2012 22:47
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@jrsconfitto
jrsconfitto / GHfW keyboard.md
Last active April 3, 2023 08:16
GitHub for Windows Keyboard Shortcuts

Keyboard shortcuts for GHfW

Here's a listing of all the GHfW keyboard stuff that i can think of. Now i know them after writing this, but i figured it would be nice to have these documentated somewhere.

Rant: i dont know why people say that Windows users dont like using the keyboard for everything. That's certainly not true for me. Though, that may be the case from using Unix in college.

All screens

You can use Alt shortcuts. Hold down Alt and you'll see the underlines. Menus brought up this way have j & k navigations! Try it on the tools menu.

@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)

@steipete
steipete / Macros.h
Last active January 6, 2024 07:24
Declare on your main init that all other init methods should call. It's a nice additional semantic warning. Works with Xcode 5.1 and above. Not tested with earlier variants, but should just be ignored. A reference to this macro shortly appeared in https://developer.apple.com/library/ios/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObj…
#ifndef NS_DESIGNATED_INITIALIZER
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer))
#else
#define NS_DESIGNATED_INITIALIZER
#endif
#endif