#なんだかんだ
##えーと1 どういうこういう そういうどういう
##えーと2 どういうこういう そういうどういう
| <?php | |
| // requires php5 | |
| define('UPLOAD_DIR', 'images/'); | |
| $img = $_POST['img']; | |
| $img = str_replace('data:image/png;base64,', '', $img); | |
| $img = str_replace(' ', '+', $img); | |
| $data = base64_decode($img); | |
| $file = UPLOAD_DIR . uniqid() . '.png'; | |
| $success = file_put_contents($file, $data); | |
| print $success ? $file : 'Unable to save the file.'; |
| #!/usr/local/bin/ruby | |
| # -*- coding: utf-8 -*- | |
| require 'cgi' | |
| filename, = ARGV # path of file `ctype-uca.c' | |
| ctype_uca = File.read(filename) | |
| ctype_uca =~ /^uchar uca_length\[256\]={\n(.*?)};$/m or raise 'uca_length not found' | |
| uca_length = $1.gsub(/\s/,'').split(/,/).map(&:to_i) |
#なんだかんだ
##えーと1 どういうこういう そういうどういう
##えーと2 どういうこういう そういうどういう
| <?php | |
| //For PHP 5.3.x or later | |
| public function emailExtended($data, $deep = false) { | |
| $pattern = '/.+@(docomo|ezweb)\.ne\.jp$/i'; | |
| $check = preg_replace_callback($pattern, function($matches) { | |
| $patterns = array('/\.{2,}/', '/\.@/'); | |
| $replacements = array('.', '@'); | |
| return preg_replace($patterns, $replacements, $matches[0]); | |
| }, array_shift($data)); | |
| return Validation::email($check, $deep); |
| <?php | |
| // Use in the "Post-Receive URLs" section of your GitHub repo. | |
| if ( $_POST['payload'] ) { | |
| shell_exec( 'cd /srv/www/git-repo/ && git pull' ); | |
| } | |
| ?>hi |
| /* Stack-based Douglas Peucker line simplification routine | |
| returned is a reduced GLatLng array | |
| After code by Dr. Gary J. Robinson, | |
| Environmental Systems Science Centre, | |
| University of Reading, Reading, UK | |
| */ | |
| function GDouglasPeucker (source, kink) | |
| /* source[] Input coordinates in GLatLngs */ | |
| /* kink in metres, kinks above this depth kept */ |
| <?php | |
| $attributeValues = array( | |
| 'color' => array('Red', 'White', 'Blue'), | |
| 'size' => array(1, 2, 3, 4), | |
| 'fabric' => array('Cloth', 'Silk') | |
| ); | |
| class Cartesian | |
| { |
| machine github.com | |
| login technoweenie | |
| password SECRET | |
| machine api.github.com | |
| login technoweenie | |
| password SECRET |