Skip to content

Instantly share code, notes, and snippets.

View damianesteban's full-sized avatar
🎯
Focusing

Damian Esteban damianesteban

🎯
Focusing
View GitHub Profile

The time is always right to do what is right. ~Martin Luther King Jr.

Summary (all you need to know)

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@damianesteban
damianesteban / List.swift
Created August 21, 2016 02:04 — forked from kristopherjohnson/List.swift
Functional list type for Swift
import Foundation
/// Abstract functional list type
///
/// Concrete types are EmptyList<T> and Cons<T>
public class List<T>: SequenceType {
/// Return true if this is an empty list, false if not
public var isEmpty: Bool { return true }
@damianesteban
damianesteban / UIImage+Tinting.swift
Created February 9, 2016 22:11 — forked from iamjason/UIImage+Tinting.swift
Swift UIImage extension for tinting images
/**
Usage:
let originalImage = UIImage(named: "cat")
let tintedImage = originalImage.tintWithColor(UIColor(red: 0.9, green: 0.7, blue: 0.4, alpha: 1.0))
*/
extension UIImage {
func tintWithColor(color:UIColor)->UIImage {
//: [Previous](@previous)
import UIKit
import Behavior
import XCPlayground
//: ## Task: Create a small counter application
//: This approach uses ports and behaviors
struct Counter {
let views = ["v1": v1, "super": self.view]
self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[super]-(<=0)-[v1(50)]", options: .AlignAllCenterY, metrics: nil, views: views))
self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[super]-(<=0)-[v1(100)]", options: .AlignAllCenterX, metrics: nil, views: views))
func passAnyObject(param: AnyObject) {
print(param)
}
class MyClass {}
struct MyStruct {}
let a: Int = 1
let b = 2.0
@damianesteban
damianesteban / DefaultKeyBinding.dict
Created November 12, 2015 19:57
xcode keybindings for emacs emulation
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* To use: copy this file to ~/Library/KeyBindings/
* after that any Cocoa applications you launch will inherit these bindings
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
F#C#ScalaClojurePythonRubyHaskellSQLOCamlCommon LispErlangSmalltalkSchemeEcmascript 5Perl 5
mapSelectmapmapmapcollectmapSelectmapmapcarmapcollect:mapmapmap
filterWherefilterfilterfilterselectfilterWherefilterremove-if-notfilterselect:filterfiltergrep
foldAggregatefoldLeftreducereduceinjectfoldl