Skip to content

Instantly share code, notes, and snippets.

View 7kaji's full-sized avatar
🍩
ドンドンドーナツどーんと行こう!

Nakajima 7kaji

🍩
ドンドンドーナツどーんと行こう!
View GitHub Profile
<?php
function main() {
$args = func_get_args();
return call_user_func_array('choice', $args) . "\n";
}
function choice() {
$args = func_get_args();
if(count($args) == 0) {
<?php
define('base_url', 'http://bijint.com/iwate/tokei_images/');
date_default_timezone_set('Asia/Tokyo');
function get_iwate_tokei_image_url() {
$image_url = base_url . date('Hi') . ".jpg";
return $image_url . "\n" . "![iwate_bijintokei]($image_url)";
}
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
history | awk '{print $2}'| sort | uniq -c | sort -nr | head -20
cat ~/.zsh_history | nkf -u | ruby -lane 'time, cmd = $_.scan(/^: (\d+):\d;(.+)$/)[0]; puts cmd.split(/\s/)[0] if time.to_i > Time.now.to_i-60*60*24' | sort | uniq -c | sort -nr | head
cat ~/.zsh_history | nkf -u | ruby -lane 'time, cmd = $_.scan(/^: (\d+):\d;(.+)$/)[0]; puts cmd.split(/\s/)[0] if time.to_i > Time.now.to_i-60*60*24' | sort | uniq -c | sort -nr | tail
# require 'bundler/setup'
require 'sinatra'
require 'sinatra/base'
require 'sinatra/reloader'
require 'twilio-ruby'
class Message < Sinatra::Base
get '/week' do
content_type 'text/xml'
Twilio::TwiML::Response.new do |r|
@7kaji
7kaji / sample.php
Created April 20, 2014 13:13
Sample code.
<?php
class Triangle {
public function __construct($width, $height){
$this->width = $width;
$this->height = $height;
}
public function get_width(){return $this -> width;}
public function get_height(){return $this -> height;}