create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
if (typeof (AC) === "undefined") { | |
AC = {} | |
} | |
AC.ImageReplacer = Class.create({ | |
_defaultOptions: { | |
listenToSwapView: true, | |
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i, | |
filenameInsert: "_☃x", | |
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i, | |
attribute: "data-hires", |
#!/usr/bin/env sh | |
## | |
# This is script with useful tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
- (BOOL) addSkipBackupAttributeToItemAtURL:(NSURL *)URL | |
{ | |
const char* filePath = [[URL path] fileSystemRepresentation]; | |
const char* attrName = "com.apple.MobileBackup"; | |
u_int8_t attrValue = 1; | |
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0); | |
return result == 0; | |
} |
# regexps to check if a string is pure chinese | |
class String | |
# 20k chars | |
CHINESE_UCS2 = /^(?: | |
[\x4e-\x9e][\x00-\xff] | |
|\x9f[\x00-\xa5] | |
)+$/xn | |
# 20k chars | |
CHINESE_UTF8 = /^(?: |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>iOS6 Safari Photo Capture Demo</title> | |
<script type="text/javascript"> | |
window.onload = function() { | |
var input = document.getElementById("input"); | |
input.addEventListener("change", handleFile); | |
} |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
package dropbox | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io" | |
"net/http" | |
"net/url" | |
"strconv" |
# ~/.osx — http://mths.be/osx | |
############################################################################### | |
# General UI/UX # | |
############################################################################### | |
# Set computer name (as done via System Preferences → Sharing) | |
scutil --set ComputerName "MathBook Pro" | |
scutil --set HostName "MathBook Pro" | |
scutil --set LocalHostName "MathBook-Pro" |
(by @andrestaltz)
So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
#!/bin/bash | |
# | |
# Using the information available in the new iOS8 simulator for each | |
# device/runtime (device.plist), this script creates a readable folder structure | |
# (no UDIDs, just simple device/runtime names). Inside that structure it creates | |
# soft links to your apps in development. | |
# | |
# You can run this script every time you install an app to your simulator, or | |
# you can simply call it to access this folder making sure it will always be | |
# updated :) |