Skip to content

Instantly share code, notes, and snippets.

View zeuxisoo's full-sized avatar
🛥️
No response

Zeuxis zeuxisoo

🛥️
No response
View GitHub Profile
@zeuxisoo
zeuxisoo / gist:1244724
Created September 27, 2011 09:56
Why interface
<?php
interface Person {
public function name();
public function gender();
}
class Tom implements Person {
// Must!!
public function name() { /* do something... */ }
public function gender() { /* do something... */ }
@zeuxisoo
zeuxisoo / gist:1297459
Created October 19, 2011 04:10
Sample animation test
<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;
}
@zeuxisoo
zeuxisoo / gist:1327085
Created October 31, 2011 07:42
Simple tips animation by CSS (keyframe)
<style type="text/css">
body {
margin: 10px;
}
.tips {
border: 1px solid #000;
padding: 5px;
-webkit-border-radius: 5px;
@zeuxisoo
zeuxisoo / gist:1378883
Created November 19, 2011 14:26
Bash profile method for fast switch to develop directory
www () {
local root
if [ $1 ]; then
path="/Users/[USER]/Desktop/htdocs/$1"
if [ -d "$path" ]; then
root=$path
else
root=$1
@zeuxisoo
zeuxisoo / gist:1392809
Created November 25, 2011 04:30
SublimeText 2 - File Settings User
{
"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
@zeuxisoo
zeuxisoo / client.js
Created January 27, 2012 09:24
node.js uncompleted chat socket test
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) {
@zeuxisoo
zeuxisoo / Method-1.md
Created February 2, 2012 15:13
simple test on ExpressJS share the config.js variable

app.js

var config = require(__dirname + '/kernel/config.js');

app.config = config;

app.get('/', controllers.index(app).index);

controllers/index.js

@zeuxisoo
zeuxisoo / gist:3083901
Created July 10, 2012 15:07
011_jQuerySite_Modified
!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)
}
@zeuxisoo
zeuxisoo / gist:3843678
Created October 6, 2012 03:35
Reroute port 80 to 3000 on iptables
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000
sudo iptables-save
@zeuxisoo
zeuxisoo / random-effect.html
Created January 21, 2013 04:56
javascript random effect on display the number
<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('');