Skip to content

Instantly share code, notes, and snippets.

View mactkg's full-sized avatar
💭
I may be slow to respond.

mactkg mactkg

💭
I may be slow to respond.
View GitHub Profile
@mactkg
mactkg / config.yml
Last active December 20, 2017 05:09
version: 2
jobs:
# いつものbuildやtestはこの下に書いておく
build_and_test:
docker:
- image: circleci/ruby:2.4.1-node
environment:
RAILS_ENV: test
steps:
- checkout # やテストなど…。
// ==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==
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
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"
// 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];
(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)
protocol Tappable {
func getName() -> String
}
class BaseViewCell {
init() {
print("Init viewCell")
}
func boom() {
@mactkg
mactkg / mixin.rb
Created April 27, 2017 07:32
MixInの練習
[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

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:

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]);
}