Skip to content

Instantly share code, notes, and snippets.

const exec = require('child_process').exec;
const request = require('request');
function loadRouteList() {
return new Promise(function (resolve, reject) {
request("http://f.ip.cn/rt/isproutes-ct.txt", function (e, res, body) {
if (e) {
reject(e);
return;
}
@licson
licson / fxaa.php
Last active February 5, 2016 16:59
FXAA in PHP
<?php
class FXAA {
const FXAA_REDUCE_MIN = 0.0078125;
const FXAA_REDUCE_MUL = 0.125;
const FXAA_SPAN_MAX = 8;
static $w = 0;
static $h = 0;
@licson
licson / steampost_embedcode.html
Last active August 29, 2015 14:01
SteamPosts
<div id="steamposts-widget"><div class="steamposts-loading">Loading SteamPosts...</div></div>
<script>(function(e){var t=e.getElementsByTagName("head")[0];var n=e.createElement("script");
n.type="text/javascript";n.src="//store.licson.net/sp.js";n.async=true;
n.onload=n.onreadystatechange=function(){if(!this.readyState||this.readyState==="complete")new SteamPosts({})};
t.appendChild(n)})(document)</script>
@licson
licson / sql.sql
Last active December 17, 2015 06:08
It's a web crawler written in node.js
-- phpMyAdmin SQL Dump
-- version 3.5.8.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 14, 2013 at 08:39 AM
-- Server version: 5.6.11-log
-- PHP Version: 5.4.14
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@licson
licson / dabblet.css
Created May 3, 2013 14:53
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@keyframes animation {
from {
transform: translateX(0px);
}
60% {
transform: translateX(36px);
@licson
licson / dabblet.css
Created May 3, 2013 14:53
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@keyframes animation {
from {
transform: translateX(0px);
}
60% {
transform: translateX(82px);
@licson
licson / dabblet.css
Created May 3, 2013 14:49
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@keyframes animation {
from {
transform: translateX(0px);
}
60% {
transform: translateX(82px);
@licson
licson / dabblet.css
Created May 2, 2013 08:11
CSS Triangles
/**
* CSS Triangles
*/
body {
margin: 20px;
}
.shape {
width: 0;
@licson
licson / dabblet.css
Created April 3, 2013 08:25 — forked from LeaVerou/dabblet.css
Just for fun: Wifi icon with pure CSS
/**
* Just for fun: Wifi icon with pure CSS
*/
.wifi {
padding: 20px;
}
.wifi, .wifi:before {
display: inline-block;
<?php
class FourierTransform {
public $bufferSize;
public $sampleRate;
public $bandwidth;
public $spectrum = array();
public $real = array();
public $imag = array();
public $peakBand = 0;
public $peak = 0;