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)
@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"
@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 = [];
@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 / test.js
Created March 6, 2014 11:15
ど、動的型付け〜
[
true,
false,
'true',
'True',
'TRUE',
'false',
'False',
'FALSE',
null,
# -*- 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)
@hority
hority / sosutwit.rb
Last active December 21, 2015 00:08 — forked from sasamijp/sosutwit.rb
# -*- encoding: utf-8 -*-
require 'rubygems'
require 'twitter'
class Integer
def prime?
n = self.abs()
return true if n == 2
return false if n == 1 || n & 1 == 0
d = n-1