Skip to content

Instantly share code, notes, and snippets.

#import "LCYThing.h"
@interface LCYThing (Transmogrify)
- (void) turnIntoCat;
@end
@Krishna
Krishna / gist:4204033
Created December 4, 2012 13:46 — forked from futureperfect/gist:1097449
Alan Kay's talk at Creative Think seminar, July 20, 1982
Alan Kay's talk at Creative Think seminar, July 20, 1982
Outline of talk: Metaphors, Magnetic Fields, Snobbery and Slogans
The best way to predict the future is to invent it.
Humans like fantasy and sharing:
Fantasy fulfills a need for a simpler, more controllable world.
Sharing is important - we're all communication junkies. We have an incredible bandwidth
@Krishna
Krishna / gist:4247608
Created December 10, 2012 00:09 — forked from BenedictC/gist:4246759
A marco for creating enums with values which can be logged (inspired by http://rentzsch.tumblr.com/post/37512716957/enum-nsstring and long train journey).
#define EMKStringableEnum(ENUM_NAME, ENUM_VALUES...) \
\
typedef enum { \
ENUM_VALUES \
} ENUM_NAME; \
\
\
\
static NSString * ENUM_NAME##ToString(long enumValue) { \
//
// StickyHeaderLayout.h
// Wombat
//
// Created by Todd Laney on 1/9/13.
// Copyright (c) 2013 ToddLa. All rights reserved.
//
// Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS!
//

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/
  Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep -H UI_APPEARANCE_SELECTOR ./* | sed 's/ __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;//'

UIActivityIndicatorView

I like Learn You a Haskell as a reference and cheat-sheet but I found it a little slow for learning Haskell.

Here's my recommended order for just learning Haskell:

http://www.seas.upenn.edu/~cis194/lectures.html Brent Yorgey's course is the best I've found so far and replaces both Yann Esposito's HF&H and the NICTA course. This course is particularly valuable as it will not only equip you to write Haskell but also help you understand parser combinators.

Real World Haskell is available online. (Thanks bos!)

I recommend RWH as a reference (thick book). The chapters for parsing and monads are great for getting a sense for where monads are useful. Other people have said that they've liked it a lot. Perhaps a good follow-up for practical idioms after you've got the essentials of Haskell down?

(swift)
(swift) func greet(name :String) -> String
{ return "hello /(name)" }
(swift)
(swift) greet
// r0 : (String) -> String = (Function)
(swift)
(swift) var temp = [greet]
// temp : Array<(String) -> String> = [(Function)]
def open_links_in_safari(project_links)
project_links_arguments = project_links.join(" ") # project_links in an array of url strings
cmd_line = "osascript newsafariwindow.scpt #{project_links_arguments}"
system(cmd_line)
end
@Krishna
Krishna / Output from curl...
Last active August 29, 2015 14:15
Sinatra caching problem
➜ Sinatra Lab curl -v http://localhost:4567/cache
* Hostname was NOT found in DNS cache
* Trying ::1...
* connect to ::1 port 4567 failed: Connection refused
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 4567 (#0)
> GET /cache HTTP/1.1
> User-Agent: curl/7.37.1
> Host: localhost:4567
> Accept: */*

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: