Skip to content

Instantly share code, notes, and snippets.

View nikuuchi's full-sized avatar

uchida nikuuchi

  • Tokyo, Japan
View GitHub Profile
@nikuuchi
nikuuchi / emcc_wget.c
Created October 22, 2014 09:34
emscripten.hを使ってみた時のメモ
#include <stdio.h>
#include <stdlib.h>
#include <emscripten.h>
void onLoadCallback(const char *filename) {
FILE *fp;
char s[256];
if((fp = fopen(filename, "r")) == NULL) {
printf("file open error!!\n");
int main() {
int i = 0
+ 1
+ 2
for int a = 1 a < 3 a++ {
int j = i
}
}
@nikuuchi
nikuuchi / output.py
Last active August 29, 2015 14:03
型付け
def f(n):
"""(<int>|<str>) -> (<int>|<str>)"""
return n #(<int>|<str>)
def g(c, d):
"""<str> -> <int> -> <str>"""
return (c * d) #<str>
print f(1) #(<int>|<str>) -> (<int>|<str>)
print f('a') #(<int>|<str>) -> (<int>|<str>)
@nikuuchi
nikuuchi / join.hs
Created May 15, 2014 15:55
文字列の配列をカンマでつなげる
join :: [String] -> String
join [] = ""
join (x:[]) = x
join (x:xs) = x ++ ", " ++ join xs
main = do
print $ join ["hoge", "fuga", "piyo"]
@nikuuchi
nikuuchi / fabfile.py
Created November 28, 2013 03:17
envの使い方メモ
from fabric.api import local, env, run, sudo, cd
from fabric.decorators import task
import time
from datetime import date
env.use_ssh_config = True
env.user = '******'
env.password = '******'
@task
@nikuuchi
nikuuchi / util.py
Created November 19, 2013 07:51
簡単なfabricのutil
from fabric.api import local, env, run, sudo, cd
from fabric.decorators import task
import time
from datetime import date
env.use_ssh_config = True
env.user = 'FIXME'
env.password = 'FIXME'
@task
@nikuuchi
nikuuchi / any.sh
Last active December 19, 2015 04:39
typescriptのソースコード中のanyの数をファイルごとに表示する
#!/bin/bash
grep any -r *.ts | sed -e 's/:.*$//g' | uniq -c
@nikuuchi
nikuuchi / ip.sh
Created June 18, 2013 05:10
ifconfigからipアドレスを切り出して表示
#!/bin/bash
ifconfig eth0 |grep inet | head -1 | awk '{print $1}' | sed -e 's/.*://'
@nikuuchi
nikuuchi / README.md
Last active December 17, 2015 01:58
ase.sh

ADS のインストール

  1. ase.shを実行する
  2. AssuranceScriptEditor/client/config.php にURLを記入
  3. サーバ側にMySQLの設定

MySQLにユーザの作成

$ mysql -u root -p

mysql&gt; GRANT ALL PRIVILEGES ON *.* TO ユーザー名@localhost IDENTIFIED BY 'パスワード';
@nikuuchi
nikuuchi / qsort.js
Created April 4, 2013 05:29
quick sortを作ってみた in JavaScript
'use strict';
function quickSort(arr) {
if (arr.length === 0) {
return arr;
} else {
var p = arr[0],
xs = arr.slice(1);
var gts = [],
lts = [],