This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
if (req.method === 'OPTIONS') { | |
console.log('!OPTIONS'); | |
var headers = {}; | |
// IE8 does not allow domains to be specified, just the * | |
// headers["Access-Control-Allow-Origin"] = req.headers.origin; | |
headers["Access-Control-Allow-Origin"] = "*"; | |
headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, OPTIONS"; | |
headers["Access-Control-Allow-Credentials"] = false; | |
headers["Access-Control-Max-Age"] = '86400'; // 24 hours | |
headers["Access-Control-Allow-Headers"] = "X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept"; |
bootstrap-tooltip.js | |
bootstrap-popover.js | |
bootstrap-alert.js | |
bootstrap-button.js | |
bootstrap-carousel.js | |
bootstrap-collapse.js | |
bootstrap-dropdown.js | |
bootstrap-modal.js | |
bootstrap-scrollspy.js | |
bootstrap-tab.js |
var express = require('express') | |
, cookieSessions = require('./cookie-sessions'); | |
var app = express(); | |
app.use(express.cookieParser('manny is cool')); | |
app.use(cookieSessions('sid')); | |
app.get('/', function(req, res){ | |
req.session.count = req.session.count || 0; |
;; ummels's solution to Palindromic Numbers | |
;; https://4clojure.com/problem/150 | |
(fn [n] | |
(letfn [(decode [n] (if (< n 10) [n] (conj (decode (quot n 10)) (rem n 10)))) | |
(encode [x] (reduce #(+ (* % 10) %2) 0 x)) | |
(next-pal [n] | |
(let [N (decode n) | |
l (count N) | |
d (quot l 2) |
#### | |
# Description:a nagios plugin script to monitor solr cloud cluster | |
# Requirements: zookeeper | |
# sudo gem install zookeeper | |
# sudo gem install rsolr | |
# | |
##### | |
require 'rubygems' | |
require 'zookeeper' | |
require 'rsolr' |
tell application "Messages" | |
set isAppRunning to false | |
tell application "System Events" | |
if (exists process "Messages") then | |
set isAppRunning to true | |
end if | |
end tell | |
if isAppRunning is false then |
#!/usr/bin/ruby | |
## Author : dennis (killme2008@gmail.com) | |
## Description : A ruby script to generate docset for dash from your public gists.Test on ruby-2.0.0-p0. | |
## Dependencies : sudo gem install sqlite3 | |
## Useage : Type command : ruby gen_docset_for_dash.rb [docset_name] [github_account] | |
## Then it will create a folder named '[docset_name].docset' in current folder,you can add the generated | |
## docset to dash in dash Preferences menu. | |
require 'rubygems' | |
require 'fileutils' |
property appleID : "yourAppleID" | |
(* | |
See post at: http://n8henrie.com/2013/04/send-imessage-messages-with-quicksilver | |
Send an iMessage to a buddy with Quicksilver. | |
Install by placing in ~/Library/Application Support/Quicksilver/Actions and restarting Quicksilver | |
First pane: pick buddy from contacts and right arrow in to select the correct phone number (or just type the phone number as text) | |
Second pane: choose this action. | |
Third pane: Enter text to send. |
Y组合子是Lambda演算的一部分,也是函数式编程的理论基础。 | |
它是一种方法/技巧,在没有赋值语句的前提下定义递归的匿名函数。 | |
即仅仅通过Lambda表达式这个最基本的“原子”实现循环/迭代。 | |
颇有道生一、一生二、二生三、三生万物的感觉。 | |
虽然Y组合子在理论上很优美,但在实际开发中并不会真的用到。 | |
想要了解Y组合子是什么,请参见维基百科:http://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combinator | |
或者知乎上的回答:http://www.zhihu.com/question/20115649 |