Skip to content

Instantly share code, notes, and snippets.

NSString *alertMessage = NSLocalizedString(@"Are you sure you want to sign out?", nil);
SGAlertView *alertView = [[SGAlertView alloc] initWithTitle:nil message:alertMessage];
[alertView addButtonWithTitle:NSLocalizedString(@"Cancel", nil) block:^{}];
[alertView addButtonWithTitle:NSLocalizedString(@"Sign out", nil) block:^{
// Handle the sign out stuff
}];
[alertView show];
[alertView release];
@kch
kch / .gitignore
Created August 26, 2010 08:19
Apple Mail plugin that fixes your sender for mailing lists
Contents/MacOS/main
# if ([a valueForKey:@"key"] == [NSNull null])
# obj.foo = [a valueForKey:@"key"];
# Copied straight into ruby
if a["key"] != nil
obj.foo = a["key"]
end
# Use a ruby method to test for nil
if !a["key"].nil?
@mybeky
mybeky / wwdc.list
Created June 16, 2013 09:50
aria2c -i wwdc.list
http://devstreaming.apple.com/videos/wwdc/2013/400xex2xbskwa5bkxr17zihju9uf/400/400-HD.mov?dl=1
dir=~/Downloads/WWDC 2013/Tools/
out=Session 400 - What’s New in Xcode 5.mov
http://devstreaming.apple.com/videos/wwdc/2013/400xex2xbskwa5bkxr17zihju9uf/400/400.pdf?dl=1
dir=~/Downloads/WWDC 2013/Tools/
out=Session 400 - What’s New in Xcode 5.pdf
http://devstreaming.apple.com/videos/wwdc/2013/401xbx2xq50gv7mqafyfdns2yhxl/401/401-HD.mov?dl=1
dir=~/Downloads/WWDC 2013/Tools/
out=Session 401 - Xcode Core Concepts.mov
http://devstreaming.apple.com/videos/wwdc/2013/401xbx2xq50gv7mqafyfdns2yhxl/401/401.pdf?dl=1
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ryansechrest
ryansechrest / html-style-guide.md
Last active June 11, 2024 14:49
HTML style guide with coding standards and best practices.

HTML Style Guide

All rules and guidelines in this document apply to HTML files.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Icon Legend:

· Space, Tab, Enter/Return

@jamesktan
jamesktan / Shell Commands ePub
Last active April 18, 2024 12:28
Unzipping & Zipping ePub from Command Line
// To unzip the epub, move the ePub to a folder, cd to it then simply:
unzip MyEbook.epub
// To zip up an epub:
1. zip -X MyNewEbook.epub mimetype
2. zip -rg MyNewEbook.epub META-INF -x \*.DS_Store
3. zip -rg MyNewEbook.epub OEBPS -x \*.DS_Store
Some explanations necessary here. We start each line with two flags:
@ertseyhan
ertseyhan / remount.sh
Created February 2, 2016 20:51
Temporarily increase size of tmp folder on Arch linux
#!/bin/bash
sudo mount -o remount,size=10G,noatime /tmp
echo "Done. Please use 'df -h' to make sure folder size is increased."
@milanboers
milanboers / clone.bash
Last active July 15, 2024 17:14
Clone all repositories of a Github user
curl -s https://api.github.com/users/milanboers/repos | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | xargs -n1 git clone
@NikhilManapure
NikhilManapure / Gif.swift
Last active October 29, 2023 07:31
Create Gif from array of UIImages in Swift 3
import Foundation
import UIKit
import ImageIO
import MobileCoreServices
extension UIImage {
static func animatedGif(from images: [UIImage]) {
let fileProperties: CFDictionary = [kCGImagePropertyGIFDictionary as String: [kCGImagePropertyGIFLoopCount as String: 0]] as CFDictionary
let frameProperties: CFDictionary = [kCGImagePropertyGIFDictionary as String: [(kCGImagePropertyGIFDelayTime as String): 1.0]] as CFDictionary