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 / install_code_server.sh
Created November 24, 2019 06:53 — forked from masuidrive/install_code_server.sh
Install code-server on Coder
#!/bin/bash
VERSION=${VERSION:-2.1692-vsc1.39.2}
WORK_DIR=/home/ubuntu/projects
USER_ID=1000
GROUP_ID=1000
PORT=8888
TARBALL_URL=https://github.com/cdr/code-server/releases/download/$VERSION/code-server$VERSION-linux-x86_64.tar.gz
@mactkg
mactkg / main.js
Last active June 20, 2018 08:43 — forked from masuidrive/main.js
Google SpreadsheetからBigQueryを呼び出すスクリプト
/**
* Google Spreadsheet向けBigQuery取り込みスクリプト
* http://toreta.blog.jp/archives/20649904.html
* License: MIT 2014- Toreta, Inc.
*
* runAllQueries() をトリガーで毎日実行してください
* Queries, Single row queries, Dataの三つのシートを作って下さい
* Queries, Single row queriesのシートには実行するクエリを書きます
* A列にクエリ名、B列にクエリです。
* conuntなどの集約関数で1行しか返らないクエリは「Single row queries」、それ以外は「Queries」に書いて下さい
@mactkg
mactkg / osxSetup.command
Created May 19, 2016 06:15 — forked from motoishmz/osxSetup.command
osx setup command. use com.apple.dock.plist
#!/bin/sh
### Desktop & Screen Saver
# Desktopを黒に
echo "Change Desctop Pictures"
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Library/Desktop Pictures/Solid Colors/Solid Gray Pro Ultra Dark.png"'
# ScreenSaver Kill
echo "Disable screensaver"
@mactkg
mactkg / on-jsx.markdown
Created March 9, 2016 06:04 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'

@mactkg
mactkg / .vimrc
Last active August 29, 2015 14:25 — forked from michaelfox/vimrc
Basic / Simple vimrc config file
set nocompatible
set encoding=utf-8
set hidden
filetype plugin indent on
syntax on
set synmaxcol=2048 " Don't syntax highlight super-long lines (for performance)
set autoindent " automatically indent lines and try to do it intelligently
set smartindent
set backspace=indent,eol,start " backspace behaves 'normally'
// ==Taberareloo==
// {
// "name" : "Fix Tumblr.getTumblelogs 2015.04"
// , "description" : "Fix Tumblr.getTumblelogs 2015.04"
// , "include" : ["background"]
// , "version" : "0.1.2"
// , "downloadURL" : "https://gist.github.com/mactkg/d19a5421c55fa40f5799/raw/ca2da60df200603d322cc7fcafb76eda1febc37f/patch.fix.tumblr.getTumblelogs.tbrl.js"
// }
// ==/Taberareloo==
@mactkg
mactkg / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/*
hatenaCardBackgroundChanger
@3846masa
iframeの属性にbackgroundを追加してcss方式で書くとなる(多分)。
*/
window.addEventListener('load',function(){
var list = document.querySelectorAll('iframe[src*="http://hatenablog.com/embed"][background]');
Array.prototype.forEach.call(list, function(node){
//===============================
// arduino
//===============================
void setup(){
Serial.begin(9600);
pinMode(13,INPUT);
}
void loop(){
@mactkg
mactkg / light.ino
Created December 2, 2013 06:28 — forked from anonymous/light.ino
void setup(){
pinMode(2,INPUT);
pinMode(9,OUTPUT);
}
int last_sw;
void loop(){
int sw = digitalRead(2);
int light=0;