ruby -e 'C=`stty size`.scan(/\d+/)[1].to_i;S="\xf0\x9f\x8c\xb8";a={};puts "\033[2J";loop{a[rand(C)]=0;a.each{|x,o|;a[x]+=1;print "\033[#{o};#{x}H \033[#{a[x]};#{x}H#{S} \033[0;0H"};$stdout.flush;sleep 0.01}'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function filecollect($conn_id,$dir='.') { | |
static $flist=array(); | |
if ($files = ftp_nlist($cid,$dir)){ | |
foreach ($files as $file) { | |
if (ftp_size($cid, $file) == "-1"){ | |
filecollect($cid,$file); | |
} else $flist[] = $file; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String trimUni(String s){ | |
int len = s.length(); | |
int st = 0; | |
char[] val = s.toCharArray(); | |
while (st < len && (val[st] <= ' ' || val[st] == ' ')) { | |
st++; | |
} | |
while (st < len && (val[len - 1] <= ' ' || val[len - 1] == ' ')) { | |
len--; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <QuartzCore/QuartzCore.h> | |
- (UIImage*) buildImageFrom: (UIView*)view { | |
UIGraphicsBeginImageContext(view .bounds.size); | |
[view.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage* viewImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return viewImage; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Config::Pit; | |
use Data::Dumper; | |
use Furl; | |
use HTTP::Request::Common; | |
use JSON::XS 'decode_json'; | |
use OAuth::Lite::Consumer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# フィルタリングルールを消去する | |
/sbin/iptables -F | |
# デフォルトポリシーを設定 | |
/sbin/iptables -P INPUT DROP | |
/sbin/iptables -P FORWARD DROP | |
/sbin/iptables -P OUTPUT DROP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map <C-f> scrollPageDown | |
map <C-b> scrollPageUp | |
let blacklists = ["https://mail.google.com/*", "*://mail.google.com/*", "@https://mail.google.com/mail/*", "*://feedly.com/*"] |