Skip to content

Instantly share code, notes, and snippets.

Avatar

Bernhard Loibl fonkadelic

View GitHub Profile
View EagerEffect.swift
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 }
}
View dateformatting.swift
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)
}
View CancelableParallel.swift
public struct Parallel<Value, Error: Swift.Error> {
public typealias Callback = (Result<Value, Error>) -> Void
public let run: (@escaping Callback) -> Void
public let cancel: () -> Void
}
View private.xml
<?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,
@fonkadelic
fonkadelic / StyleSettings.plist
Created Feb 1, 2014
My Objective-Clean style settings
View StyleSettings.plist
<?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/>
View Preferences.sublime-settings
{
"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":
[
@fonkadelic
fonkadelic / gist:1016554
Created Jun 9, 2011
Mac Rails Installation
View gist:1016554
# 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
View application.html.erb
<!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 Jun 9, 2011
zwitscher main style
View main.css
* {
margin: 0; padding: 0;
}
body {
background: #8ec1da;
font:13px/1.5 Helvetica Neue,Arial,Helvetica,'Liberation Sans',FreeSans,sans-serif;
color: #444;
}
You can’t perform that action at this time.