##Objective-C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
request = require 'request' | |
express = require 'express' | |
app = express() | |
client = | |
id : "xxxx" | |
secret : "xxxx" | |
callback: "http://localhost:3000/callback" | |
app.get '/', (req, res) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html,<title>md</title><script src='http://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js'></script><style>#a,#b{width:50%;height:100%;float:left;outline:none}@media print{#a{display:none;}}</style><div id='a' contenteditable>md</div><div id='b'></div><script>var c=function(a){return document.getElementById(a)};c('a').addEventListener('keydown',function(e){if(e.keyCode==9){e.preventDefault();document.execCommand('insertText',![],'\t');return ![];}setTimeout(function(){c('b').innerHTML=marked(c('a').innerText)},0)})</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
infix operator ||| { associativity left precedence 80 } | |
func ||| (lhs: Layout.Panel, rhs: Layout.Panel) -> Layout.Panel { | |
return Layout.Panel(forkType: .Horizontal , panel1: lhs, panel2: rhs) | |
} | |
infix operator --- { associativity left precedence 80 } | |
func --- (lhs: Layout.Panel, rhs: Layout.Panel) -> Layout.Panel { | |
return Layout.Panel(forkType: .Vertical , panel1: lhs, panel2: rhs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
Example: | |
$ ./make10 7 6 9 5 | |
(6,Plus,9,Divide,5,Plus,7) | |
(9,Plus,6,Divide,5,Plus,7) | |
-} | |
import System.Environment | |
import Control.Monad | |
import Data.List |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import concurrent.futures) | |
(import sys) | |
(import subprocess) | |
(import time) | |
(import [collections [defaultdict]]) | |
(import [data [sentences]]) | |
(defn sent2kgram [sentence &optional [k (int "2")] [delimiter " "]] | |
(setv sentence (str (.getoutput subprocess (.format "echo {0} | mecab -O wakati" sentence)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var contEach = function(arr,f) { | |
if (arr.length == 0) {return;} | |
var next = function(){contEach(arr.splice(1),f);} | |
f(arr[0], next); | |
} | |
// Example | |
contEach(queries, function(query, next){ | |
$.get("https://www.google.co.jp/search?q="+query,function(body){ | |
// some process with body |
class: center, middle #Gist Slide Gist をそのままスライドに
layout: false #Gist Slide
.font-size-large[ Gist Slide は Gist に書かれたmarkdownをそのままremark.jsに渡してスライドにする。ただそれだけのChrome Extensionです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template <int N, int M> | |
struct is_factor { | |
static const bool value = N % M == 0; | |
}; | |
template <int N, int M> | |
struct divide_test { | |
static const bool value = !is_factor<N, M>::value && divide_test<N, M-1>::value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ = require 'lodash' | |
item = (cs) -> | |
if cs == "" | |
return [] | |
else | |
return [[cs[0], cs.slice(1)]] | |
# Monad Methods |
OlderNewer