Skip to content

Instantly share code, notes, and snippets.

View tumblr_auto_scroll.tmpl.js
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.tumblr.com/dashboard
// @grant none
// ==/UserScript==
View addeable_extender.rb
module AddableExtender
def define_adder(*keys)
define_method :+ do |other|
result = keys.map { |key| send(key) + other.send(key) }
self.class.new(*result)
end
end
end
Point = Struct.new(:x, :y) do
View 20170630.tidal
d3 $ sound "bd bd bd"
d5 $ loopAt 0.5 $ chop 4 $ sound (samples "alphabet" (irand 12))
d1 $ sound "808*4" # n (irand 12)
d2 $ sound "808oh*8" # gain "[0.8 0.9 0.7 0.8]*2"
d4 $ sound "cp cp cp"
View export_symbols_as_svg.js
// fork of https://github.com/marianomike/sketch-exportsymbols?ref=sketchhunt
function alert(title, message){
var app = [NSApplication sharedApplication];
[app displayDialog:message withTitle:title];
}
//reference the sketch document
var doc = context.document;
//reference the pages array in the document
var pages = [doc pages];
View result.txt
(Ruby 2.2.2)
user system total real
Scale: 1
shuffle and take 0.010000 0.000000 0.010000 ( 0.007580)
sample 0.000000 0.000000 0.000000 ( 0.004182)
Scale: 10
shuffle and take 0.010000 0.000000 0.010000 ( 0.011985)
sample 0.020000 0.000000 0.020000 ( 0.016216)
View MyPlayground.swift
protocol Tappable {
func getName() -> String
}
class BaseViewCell {
init() {
print("Init viewCell")
}
func boom() {
@mactkg
mactkg / mixin.rb
Created Apr 27, 2017
MixInの練習
View mixin.rb
[1] pry(main)> module MixIn
[1] pry(main)* def hello
[1] pry(main)* puts "hello from MixIn"
[1] pry(main)* end
[1] pry(main)* end
=> :hello
[2] pry(main)> class A
[2] pry(main)* include MixIn
[2] pry(main)* end
View keybase.md

Keybase proof

I hereby claim:

  • I am mactkg on github.
  • I am mactkg (https://keybase.io/mactkg) on keybase.
  • I have a public key whose fingerprint is D37A 9A0F 61CD 4955 3EA3 E1D6 FB3C DD30 0D11 2126

To claim this, I am signing this object:

View upload_image_to_gyazo_using_fetch_api.js
var gyazo_data = {
client_id: "ID_HERE",
image_url: "IMAGE_URL",
referer_url: "URL"
};
var form_data = new FormData();
for (var key in gyazo_data) {
form_data.append(key, gyazo_data[key]);
}
@mactkg
mactkg / webmo_osc_api.md
Last active May 30, 2016
http://webmo.io とOSCで通信するためのドキュメントです。
View webmo_osc_api.md

Webmo OSC API v0.1.0(20160530)

ポート番号 12345 にて、UDPで待ち受けています。

/rotate [speed:Number]

  • 毎秒speed度で回転し続けます。

/rotateBy [diff:Number] [speed:Number]

  • 毎秒speed度でdiff度回転します。
  • ステッピングモーターの性質を使っているため精度が高いです。
  • 注: diffの値は0.0140625度刻みになるため注意してください。
You can’t perform that action at this time.