This file contains hidden or 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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| if ( ! function_exists('send_post')) | |
| { | |
| function send_post($data,$url) | |
| { | |
| $header = array( | |
| "Content-Type: application/x-www-form-urlencoded", | |
| "Content-Length: ".strlen($data) | |
| ); |
This file contains hidden or 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
| $ () -> | |
| ctx = document.getElementById("demo").getContext("2d") | |
| ctx.strokeStyle = "#000" | |
| ctx.fillStyle = "#000" | |
| for x in [0..8] | |
| ctx.strokeRect x*80,0,80,280 | |
| for x in [60,140,300,380,460] | |
| ctx.fillRect x,0,40,170 | |
| player = new Simulator() | |
| $("#play").click () -> |
This file contains hidden or 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 | |
| cd $HOME | |
| sudo apt-get update | |
| sudo apt-get upgrade -y | |
| sudo apt-get install vim tmux zsh build-essential cmake cmake-curses-gui python-setuptools git tig subversion clang llvm emscripten default-jdk -y | |
| # server | |
| #sudo tasksel install lamp-server openssh-server | |
| # Latex(for 12.10 or 13.04) | |
| #sudo apt-get install texlive texlive-lang-cjk auctex xdvik-ja |
This file contains hidden or 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/sh | |
| xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync | |
| xrandr --addmode Virtual1 1600x900_60.00 | |
| xrandr --output Virtual1 --mode 1600x900_60.00 |
This file contains hidden or 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
| 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 | |
| ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 | |
| 192.168.59.150 totsuka | |
| 192.168.59.151 ofuna | |
| 192.168.59.160 fujisawa |
This file contains hidden or 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 ruby | |
| require 'open-uri' | |
| require 'nokogiri' | |
| dict = Nokogiri::HTML(open("http://ejje.weblio.jp/content/#{ARGV[0].downcase}")).search("div.Kejje") | |
| dict.search("script").remove | |
| dict.search("div.level0").each{|node| puts node.text.delete("\r")} |
This file contains hidden or 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
| let rec fibo n = if n < 2 | |
| then 1 | |
| else fibo(n-1)+fibo(n-2);; | |
| print_int(fibo(36));; | |
| print_string("\n");; |
This file contains hidden or 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 f(){ | |
| $i=0; | |
| return function() use(&$i){ | |
| return $i++; | |
| }; | |
| }; | |
| $c = f(); | |
| foreach(range(0,10) as $a){ | |
| echo $c(),"\n"; |
This file contains hidden or 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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| if ( ! function_exists('h')) | |
| { | |
| function h($str) | |
| { | |
| return htmlspecialchars($str,ENT_QUOTES,"UTF-8"); | |
| } | |
| } |
This file contains hidden or 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 bash | |
| num=`ps aux|grep emacs\ -nw\ --daemon|wc -l` | |
| if [ $num = 1 ] | |
| then | |
| TERM=xterm-256color emacs -nw --daemon | |
| else | |
| echo 'Emacs is already running.' | |
| fi |