Skip to content

Instantly share code, notes, and snippets.

@alea12
alea12 / pigeon.php
Last active December 15, 2015 11:39 — forked from okumin/pigeon.php
<?php
$target = "";
$timestamp = date('Y-m-d hms');
$next_cursor = -1;
$f = fopen($target . " - " . $timestamp . ".txt", "w");
while($next_cursor != 0) {
$api = "https://api.twitter.com/1/followers/ids.xml?cursor=" .
$next_cursor . "&screen_name=" . $target;
require 'rubygems'
require 'twitter'
target = ''
next_cursor = -1
Twitter.configure do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''
@alea12
alea12 / favbomb.rb
Last active December 15, 2015 13:58
require 'rubygems'
require 'twitter'
Twitter.configure do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''
config.oauth_token_secret = ''
end
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@alea12
alea12 / twitter.rb
Created May 7, 2013 01:07
Using Twitter API by Ruby
require 'rubygems'
require 'twitter'
Twitter.configure do |config|
config.consumer_key = 'CONSUMER_KEY'
config.consumer_secret = 'CONSUMER_SECRET'
config.oauth_token = 'ACCESS_TOKEN'
config.oauth_token_secret = 'ACCESS_TOKEN_SECRET'
end
\documentclass{book}
\usepackage[dvipdfmx]{graphicx}
\pagestyle{empty}
%--preamble--
\makeatletter
\parsep = 0pt
\labelsep = .5zw
\def\@listi{%
\leftmargin = 2zw \rightmargin = 0pt
@alea12
alea12 / AvailableFonts.java
Last active December 17, 2015 14:29
List available fonts of the environment using Java
import java.awt.*;
public class AvailableFonts {
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
Font[] avfonts = ge.getAllFonts();
for (Font f : avfonts) {
System.out.println(f.getFontName());
}
<?php
require_once('class.image.php');
$target_file = 'data/' . $_GET['t'];
$size_info = getimagesize($target_file);
$original_width = $size_info[0];
$original_height = $size_info[1];
// remove dashes from top, left sides
@alea12
alea12 / prisoner.rb
Last active December 18, 2015 21:09
囚人のジレンマ
# input:
# strategy_i - strategy of player 1, 2.
# output:
# payoff_i - payoff rewarded to player 1, 2.
def prisoner (strategy_1, strategy_2)
if strategy_1 == "m"
if strategy_2 == "m"
payoff_1 = -1
payoff_2 = -1