var config = require(__dirname + '/kernel/config.js');
app.config = config;
app.get('/', controllers.index(app).index);
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 | |
interface Person { | |
public function name(); | |
public function gender(); | |
} | |
class Tom implements Person { | |
// Must!! | |
public function name() { /* do something... */ } | |
public function gender() { /* do something... */ } |
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
<style type="text/css"> | |
img:hover { | |
-webkit-animation-name: tp1; | |
-webkit-animation-duration: 1.9555s; | |
-webkit-animation-iteration-count: infinite; | |
cursor: pointer; | |
} | |
img { | |
display: block; | |
} |
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
<style type="text/css"> | |
body { | |
margin: 10px; | |
} | |
.tips { | |
border: 1px solid #000; | |
padding: 5px; | |
-webkit-border-radius: 5px; |
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
www () { | |
local root | |
if [ $1 ]; then | |
path="/Users/[USER]/Desktop/htdocs/$1" | |
if [ -d "$path" ]; then | |
root=$path | |
else | |
root=$1 |
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
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", | |
"font_face": "Monaco", | |
"font_size": 12, | |
"fallback_encoding": "UTF-8", | |
"trim_trailing_white_space_on_save": true, | |
"highlight_line": true, | |
"spell_check": false |
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 net = require('net'); | |
var client = net.connect(5891, function() { | |
console.log('Connected to server'); | |
}); | |
client.on('data', function(data) { | |
var command = JSON.parse(new Buffer(data).toString()); | |
switch(command.name) { |
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($) { | |
$(function() { | |
var hash = window.location.hash.substr(1); | |
var href = $('#nav li a').each(function(){ | |
var href = $(this).attr('href'); | |
if(hash==href.substr(0,href.length-5)){ | |
var toLoad = hash+'.html #content'; | |
$('#content').load(toLoad) | |
} |
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
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000 | |
sudo iptables-save |
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
<div id="random-area">1</div> | |
<script language="javascript"> | |
var max_random = 100, | |
random_area = document.getElementById("random-area"), | |
origin_text = random_area.innerHTML; | |
function random(max_random) { | |
var arr = "0123456789".split(''); |