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 / gist:3076555
Created July 9, 2012 13:27
はいれつ
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <limits.h>
#define NUM 100000
#define N 2147483647L
int main(void){
long long int i;
clock_t start,end;
@mactkg
mactkg / jinkouchinou.py
Created October 17, 2012 16:29 — forked from salexkidd/jinkouchinou.py
やったー!Pythonでも人工知能できたよー!\(^o^)/
# -*- coding:utf-8 -*-
import random
def main():
word_list = [u'マジで', u'ヤバい', u'ウケるー', ]
while True:
raw_input(">>>")
print random.choice(word_list)
@mactkg
mactkg / fft.py
Last active December 12, 2015 08:39 — forked from sgk/fft.py
import math
def fft(n, data):
theta = math.pi * 2 / n
def scramble(k, i):
while True:
i ^= k
if i >= k:
return i
@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;
@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 / 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 / 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 / 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