Skip to content

Instantly share code, notes, and snippets.

@fonkadelic
fonkadelic / StyleSettings.plist
Created February 1, 2014 14:48
My Objective-Clean style settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>kRequireSpaceAfterColon</key>
<false/>
<key>kRequireOpenBraceOnMethodSignatureLine</key>
<false/>
<key>kRequireOpenBraceOnConditionalStatementLine</key>
<false/>
@fonkadelic
fonkadelic / application.html.erb
Created June 9, 2011 08:06
Application Template
<!DOCTYPE html>
<html>
<head>
<title>Zwitscher</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<body>
<div id="wrapper">
@fonkadelic
fonkadelic / main.css
Created June 9, 2011 08:04
zwitscher main style
* {
margin: 0; padding: 0;
}
body {
background: #8ec1da;
font:13px/1.5 Helvetica Neue,Arial,Helvetica,'Liberation Sans',FreeSans,sans-serif;
color: #444;
}
@fonkadelic
fonkadelic / gist:1016554
Created June 9, 2011 11:29
Mac Rails Installation
# Get rid of Apple Supplied Gems
sudo rm -Rf /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
# Update Ruby Gems
sudo gem update --system && sudo gem clean
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"font_face": "Source Code Pro",
"font_size": 15,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
<?xml version="1.0"?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix>
<identifier>private.f192f19_escape</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
public struct Parallel<Value, Error: Swift.Error> {
public typealias Callback = (Result<Value, Error>) -> Void
public let run: (@escaping Callback) -> Void
public let cancel: () -> Void
}
let now = Date()
func format(withIdentifier identifier: String) -> String {
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: identifier)
dateFormatter.setLocalizedDateFormatFromTemplate("EEEE, MMMM d, yyyy")
return dateFormatter.string(from: now)
}
public final class EagerEffect<A> {
private var callbacks: [(A) -> Void] = []
private var value: A? {
didSet { value.map(notify) }
}
public init(run: @escaping (@escaping (A) -> Void) -> Void) {
run { self.value = $0 }
}