Skip to content

Instantly share code, notes, and snippets.

View perforb's full-sized avatar

Yusuke Maeda perforb

View GitHub Profile
@perforb
perforb / Dump.java
Last active December 16, 2015 05:08
package sysprop;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Properties;
public class Dump {
public static void main(String[] args) {
Properties properties = System.getProperties();
awt.nativeDoubleBuffering=true
awt.toolkit=apple.awt.CToolkit
file.encoding=UTF-8
file.encoding.pkg=sun.io
file.separator=/
ftp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16
gopherProxySet=false
http.nonProxyHosts=local|*.local|169.254/16|*.169.254/16
java.awt.graphicsenv=apple.awt.CGraphicsEnvironment
java.awt.printerjob=apple.awt.CPrinterJob
@perforb
perforb / development.pl
Last active November 4, 2023 13:53
Easily import the settings in Perl.
+{
mysql => {
user => 'volt',
password => 'voltisfast',
},
}
@perforb
perforb / version.sh
Last active December 14, 2015 03:09
Shows nginx version and configure arguments.
nginx -V 2>&1 | sed 's/--/\n--/g'
### or using perl
### nginx -V 2>&1 | perl -pe 's/--/\n--/g'
@perforb
perforb / history_cleaner.pl
Created January 26, 2013 13:24
.(BASH|ZSH)_HISTORY CLEANER - Delete duplicate rows as keeping the order.
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw(say);
my @lines;
while (<>) {
chomp;
next unless $_;
push @lines, $_;
@perforb
perforb / unix_timestamp.js
Created January 8, 2013 16:36
Variation of current Unix timestamp.
// using static methods
console.log(Date.now()); // 1357662789317
// if you have Date objects
console.log(new Date().getTime()); // 1357662789317
// numeric context
console.log(+new Date); // 1357662789317
console.log(+new Date()); // 1357662789317
@perforb
perforb / Tweets Importer
Last active September 16, 2019 19:12
Tweets Importer - Imports your tweets to MySQL.
create database tweets_importer character set utf8;
create table user_timeline(
id int(10) auto_increment
,uid int(10) not null
,name varchar(255) not null
,text varchar(255) not null
,source varchar(255) not null
,retweet_count int(10) not null
,favorited int(1) not null
,retweeted int(1) not null
@perforb
perforb / encapsulated.js
Last active October 12, 2015 00:57
Encapsulated object.
var obj = (function() {
var _canvas = 'canvas';
function _radian(x) {
return x * Math.PI / 180;
}
// public api
return {
canvas: _canvas,
radian: _radian
@perforb
perforb / main.cpp
Last active October 9, 2015 09:28
C++初心者が荷物運びゲームをつくってみた
/*
平山尚『ゲームプログラマになる前に覚えておきたい技術』より
お題:荷物運びゲームを2時間以内につくる
*/
#include<iostream>
using namespace std;
char screen[5][8] = {
@perforb
perforb / classic.sh
Created August 16, 2012 13:10
Comparison of `find`
find . -name "*.php" -exec rm -v {} \; | tee /dev/tty | wc -l