Skip to content

Instantly share code, notes, and snippets.

{
"lastupdate":"2015-10-30 00:50:00",
"puzzles":
{
"2015-10-01":
{
"18:00:00":
{
"title":"In JS, when I create an object with initial value, like {}. How much space the object will have in head ? Will it expand automatically ?",
"desc":"I am working on implementing all frequently used data structures in JS. When I was doing HashTable, I saw there are two variables: capacity and load factor and one function called rehash() in HashTable of Java. But I don't know how to implement this in JS, seems I don't need to do anything about the memory management.",
# -*- coding=utf-8 -*-
# Update 2-12
# Add spam IP list and ignore the spam IPs
# Add a time delay for ipinfo API - There is a limit usage for the ipinfo api: 1000/day for free, if you want more, you can buy from the website
# You can edit and add your spam ips list file yourself, remember separate your ip address with other information by one space.
import urllib
import json
import os

Breaking Bad

A tribute to the best fucking series in the world.

Just some CSS and SVG. I created the SVG from the original Logo with Photoshop (path) and Illustrator (SVG).

The making of: http://timpietrusky.com/breaking-bad-logo

@taoalpha
taoalpha / fireworks.html
Last active August 29, 2015 14:08
Use canvas show a beautiful fireworks
<!DOCTYPE html>
<html>
<head>
<title>I love U</title>
<meta charset="UTF-8">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="improvedNoise.js"></script>
<script type="text/javascript" src="fizzyText.js"></script>
<script type="text/javascript">
//requestAnimationFrame动画方法的兼容性
@taoalpha
taoalpha / mysqlcheck.sh
Last active August 29, 2015 14:05
simple shell script which can restart mysql when your site down.
log=autocheck.log
nflag=`curl --connect-timeout 3 --max-time 2 "http://callmet.zzgary.info/link/" -o $log`
# change the grep text according to your condition.
err=$?
# get the error code.
flag=`cat $log | grep "Database Error" -c`
pflag=`cat $log | grep "502 Bad Gateway" -c`
#echo $err;
#echo $flag;
#echo $pflag;
@taoalpha
taoalpha / transfer.js
Last active August 29, 2015 14:05
Using nodejs with bower set up your own CDN or resource library.
// Use bower install to install modules and then run the transfer.js to copy all the main files in each modules to root dir
// Mainly use as a quick tool to manage your cdn or resource library.
// directory structure:
// ├───root
// ├───js/
// └───jqeury
// └───jquery.js
// └───jquery.min.js
// └───css/
// └───normalize.css