Skip to content

Instantly share code, notes, and snippets.

@2RiniaR
2RiniaR / MoveCamera.cs
Created February 15, 2019 06:42
UnityでMinecraftみたいなカメラの挙動を実装するスクリプト
/*
【 マウス+WASDキーによるカメラ操作 】
作成者:watano
必ずカメラにアタッチしてください。
Space : 上移動(+y)
Shift : 下移動(-y)
W : 前移動(+z)
S : 後移動(-z)
A : 左移動(-x)
@takano32
takano32 / gist:2420348
Created April 19, 2012 11:24
VALUE DOMAIN のサポートはこんなもんだった
○カテゴリー ドメイン - DNS
○題名 名前解決されない
○メールアドレス takano32@gmail.com
○URL/ドメイン no32.tk
○作成日時 2012-03-30 18:20:21
○更新日時 2012-04-25 16:27:34
○メッセージ内容  
$ dig no32.tk
で名前が引けない
@aita
aita / gist:5895106
Created June 30, 2013 13:14
算術平均と幾何平均
import numpy as np
from scipy.stats import gmean
d1 = [2,4,5,7]
d2 = [2,4,5,70]
print np.average(d1), np.average(d2)
print gmean(d1), gmean(d2)
@penguin2716
penguin2716 / pdf2outline.sh
Created August 1, 2016 04:42
convert a PDF file to outline PDF
#!/bin/bash
if [ "x$1" = "x" -o "x$2" = "x" ]; then
echo Usage: `basename "$0"` "<input.pdf>" "<output.pdf>" >&2
exit 1
fi
# change 'ps2write' to 'pswrite' if errors
gs -sDEVICE=ps2write -dNOCACHE -sOutputFile=- -q -dbatch \
-dNOPAUSE -dQUIET "$1" -c quit | ps2pdf - "$2"
@firstspring1845
firstspring1845 / mandel.py
Created September 22, 2015 15:10
draw Mandelbrot set / requires PIL
import itertools
from PIL import Image
#def mandel(z, c):
# return z ** 2 + c
result = Image.new("L", (400, 400))
for r, i in itertools.product(xrange(400), repeat=2):
@ikr7
ikr7 / besiege_gen.js
Created February 5, 2016 12:35
Besiegeで関数プロットするやつ、 block_id と scale と density と f を適当に変えれば適当に動く
var block_id = 0;
var scale = 10;
var density = 10;
function f (x) {
return Math.pow(x, 3);
};
var prefab_ids = [];
# -*- encoding: utf-8 -*-
require 'rubygems'
require 'tweetstream'
require 'twitter'
require 'mysql2'
require './key.rb'
Twitter.configure do |config|
config.consumer_key = Const::CONSUMER_KEY
config.consumer_secret = Const::CONSUMER_SECRET
@Hiromi-Kai
Hiromi-Kai / namechanger.rb
Last active December 27, 2015 16:19 — forked from anonymous/namechanger.rb
original source by @sasamijp
# -*- encoding: utf-8 -*-
require 'twitter'
class UpdateString < String
def delete_account_name(sasamljp)
self.sub("(#{sasamljp})",'')
end
def delete_at_mark
self.gsub(/(@|@)/,'')
@ikr7
ikr7 / app.js
Last active December 27, 2015 15:59
sasamijpのあれ ntwitterが必要です
var ntwitter = require('ntwitter');
var twi = new ntwitter({
'consumer_key': '',
'consumer_secret': '',
'access_token_key': '',
'access_token_secret': ''
});
var my_screen_name = '';
@kazoo04
kazoo04 / ginko.rb
Last active December 25, 2015 18:49
ぎんこさんワロタbotの精度向上
require 'rubygems'
require 'levenshtein'
require 'shellwords'
def similar(s1, s2, threshold = 2)
d = Levenshtein.distance(toKatakana(s1), toKatakana(s2))
d <= threshold
end
def toKatakana(str)