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
var n = 79.99 * 100; | |
//=> 7998.999999999999 | |
Math.floor(n); | |
//=> 7998 | |
Shit! |
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
Add http_digest_auth for Cloud9 IED. | |
Step: | |
1.git clone https://github.com/ajaxorg/cloud9.git | |
2.git submodule update --init --recursive | |
3.git apply cloud9.patch | |
4.bin/cloud9.sh -c config.js | |
5.open the url http://127.0.0.1:3000/ | |
6.when prompt the authorization,username is admin and password is admin. |
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 strict'; | |
const http = require('http'); | |
const url = require('url'); | |
const path = require('path'); | |
const fs = require('fs'); | |
const port = process.argv[2] || 8888; | |
http.createServer((req, res) => { | |
const uri = url.parse(req.url).pathname; |
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 | |
/** | |
* CloudFlare 사용시 실제 방문자 IP 및 SSL 사용 여부를 | |
* 정확하게 파악하지 못하는 문제를 해결하는 클래스 | |
* 웹서버에 mod_cloudflare를 설치하기 곤란한 경우 사용한다 | |
* | |
* Written by 기진곰 <kijin@kijinsung.com> | |
* License: Public Domain | |
* |
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 | |
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | |
# http://creativecommons.org/publicdomain/zero/1.0/ | |
function ampify($html='') { | |
# Replace img, audio, and video elements with amp custom elements | |
$html = str_ireplace( | |
['<img','<video','/video>','<audio','/audio>'], |
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
<? | |
function compareText($str1, $str2) { | |
$str1 = split(" ", $str1); | |
$str2 = split(" ", $str2); | |
$count = 0; | |
for ($i = 0; $i < sizeof($str1); $i++) { | |
for ($j = 0; $j < sizeof($str2); $j++) { | |
if ($str1[$i] == $str2[$j]) $count++; |
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 is_utf8($str) { | |
$temp_str = @iconv('utf-8', 'utf-8', $str); | |
if ($str === $temp_str) { | |
return 'utf8'; | |
} else { | |
return 'gbk'; | |
} |
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
/** pQuery! LOL **/ | |
Object.extend($, Prototype); | |
Object.extend($, Object); | |
/** | |
* Returns window dimensions and scroll positions | |
* @author Firejune<to@firejune.com> | |
* @license MIT | |
*/ |
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
window.fully = (function(win, doc) { | |
function viewer(options) { | |
win._cb = function(obj) { | |
var image = doc.getElementById(options.elementId); | |
image.src = '//www.bing.com' + obj.query.results.json.images.url; | |
if (image.complete) { | |
addClassName(image, 'active', true); | |
} else { | |
image.onload = function() { | |
addClassName(image, 'active', true); |
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
var MT32Module=(function(){var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function";var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolve"](filename)){filename=path.join(__dirname,"..","src",filename);ret=nodeFS["readFileSync"](filename)}if(ret& |
OlderNewer