Skip to content

Instantly share code, notes, and snippets.

View phoenixg's full-sized avatar
😘
Fall in love

Phx phoenixg

😘
Fall in love
  • Shanghai, China
View GitHub Profile
FROM ubuntu
RUN sudo echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN sudo apt-get update
RUN sudo apt-get install -y Dialog
RUN sudo apt-get install -y wget
RUN sudo apt-get install -y vim
RUN sudo apt-get install -y git
RUN sudo apt-get install -y gcc
RUN sudo apt-get install -y make
#!/bin/bash
# tested successfully on digitalocean Ubuntu 12.40 with docker version
# after run this script, then wget youtube-dl.support1080p.sh gist, then 1080p download is working
sudo apt-get -y install vim
sudo apt-get -y install git
sudo apt-get -y install gcc
sudo apt-get -y install make
sudo apt-get -y install yasm
wget http://kakola.googlecode.com/files/lame-3.98.4.tar.gz
tar zvxf lame-3.98.4.tar.gz
@phoenixg
phoenixg / osc.2014.aprilfool.js
Created April 1, 2014 09:53
OSC 2014年愚人节模糊页面代码
/*
* by moli
*/
$(document).ready(function(){
if(document.cookie.indexOf("lu=") == -1 ){
// 延时2秒
setTimeout("jQuery.mxblur.interID = setInterval('jQuery.mxblur.begin()', 5)", 1500);
}
});
@phoenixg
phoenixg / classify.php
Created March 18, 2013 06:34
数组排序吗?
<?php
class Classify {
public $idKey = '';
public $parentIdKey = '';
/**
*
* @param string $formatStr
*/
public function __construct() {
<?php
// http://www.paulund.co.uk/encode-email-with-php
/**
* Encode an email address to display on your website
*/
function encode_email_address( $email ) {
$output = '';
for ($i = 0; $i < strlen($email); $i++)
{
@phoenixg
phoenixg / Fibonacci.php
Created May 9, 2013 09:55
用PHP迭代器来实现一个斐波纳契数列
<?php
// 用PHP迭代器来实现一个斐波纳契数列
// 转载自: http://www.nowamagic.net/librarys/veda/detail/2164
class Fibonacci implements Iterator {
private $previous = 1;
private $current = 0;
private $key = 0;
public function current() {
return $this->current;
#!/bin/bash
if [ $(id -u) != "0" ]; then
printf "Error: You must be root to run this tool!\n"
exit 1
fi
clear
printf "
####################################################
# #
@phoenixg
phoenixg / ilovewujiamin.v1.js
Created October 8, 2013 05:30
authored by justjavac
([]+[])[ ([][(![ ]
+[])[+[ ]]+([![ ]]+[][ []])[+
!+[]+[+ []]]+(! []+[]) [!+[]+!+[
]]+(!![ ]+[])[+ []]+(! ![]+[])[
!+[]+!+ []+!+[] ]+(!![ ]+[])[+!
+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+
@phoenixg
phoenixg / raspi.20131202-20131203
Last active December 30, 2015 03:29
树莓派定时拍摄一天的固定场景
raspistill -o photo%04d.jpg -w 800 -h 600 -q 10 -t 99999999 -tl 600000 &
raspistill -o photo%04d.jpg -q 100 -t 99999999 -tl 600000 &
# 照片见微云
total 6.7M
drwxr-xr-x 2 pi pi 4.0K Dec 3 19:50 .
drwxr-xr-x 7 pi pi 4.0K Dec 3 19:56 ..
-rw-r--r-- 1 pi pi 44K Dec 2 21:39 photo0001.jpg
-rw-r--r-- 1 pi pi 44K Dec 2 21:49 photo0002.jpg