Skip to content

Instantly share code, notes, and snippets.

function doGet(e) {
var vocabulary = e.parameter.v
var from = e.parameter.f
if (!vocabulary) {
return ContentService.createTextOutput("パラメータvが空だよ!");
}
if (!from) {
return ContentService.createTextOutput("パラメータfが空だよ!");
}
import asyncio
async def sleep(s):
await asyncio.sleep(s)
print("🍣")
print(s)
return s
if __name__ == '__main__':
@haranicle
haranicle / split NSString
Last active July 2, 2017 08:35
split NSString
var str: NSString = "abcdef"
for i in 0..<str.length {
print(str.substring(with: NSRange(location: i, length: 1)))
}
#!/bin/sh
# settings
DEVICE_TOKEN="XXXXXX"
TOPIC="com.your.app.bundle.id"
# process
DATE="`date \"+%Y/%m/%d %H:%M:%S\"`"
mkdir tmp && \
ffmpeg -i img.mov -an -r 5 tmp/%04d.png && \
convert tmp/*.png -resize 40% tmp/output_%04d.png && \
convert -delay 12 tmp/output_*.png img.gif && \
convert -layers Optimize img.gif img.gif && \
rm -rf tmp
import Foundation
class Thunder { }
class Fire { }
protocol Pokemon {
associatedtype PokemonType
func attack(move:PokemonType)
}
@haranicle
haranicle / CodePiece.swift
Created June 11, 2016 08:18
いいえ逃 #CodePiece #cswift
let param
let a: String = { @noescape () -> String in
param // self.がいらない!
}()
@haranicle
haranicle / CodePiece.swift
Created June 11, 2016 08:13
メモ #CodePiece #cswift
@available(*, unavailable, message="Hello!")
@available(*, unavailable, renamed="newFunc")