Skip to content

Instantly share code, notes, and snippets.

View zhuzhuaicoding's full-sized avatar

zhuzhu_coder zhuzhuaicoding

View GitHub Profile
@zhuzhuaicoding
zhuzhuaicoding / debugging_c_with_llvm.md
Created May 27, 2017 06:25 — forked from gregmalcolm/debugging_c_with_llvm.md
Debugging C with llvm's clang and lldb

Assuming you llvm installed (comes as standard on Mac OS Mavrick xtools)

Create a helloworld.c file:

  #include<stdio.h>
  
  int main()
  {
 int x=3;
function getDocHeight() {
var D = document;
return Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
}
(function(window,undefined){
// Prepare our Variables
var
document = window.document,
$ = window.jQuery;
// Wait for Document
$(window).bind(function(){
// Prepare Variables
function getGroupCallBackGenerator(timeOut,finalCallback){
var waitingStatus={};
var resultObject={};
var started=false;
var timedOut=false;
var timer=setTimeout(function(){
timedOut=true;
if(typeof(finalCallback)=="function"){
finalCallback(resultObject);
}
<!DOCTYPE html>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name=apple-mobile-web-app-capable content=yes>
<meta name=apple-mobile-web-app-status-bar-style content=black>
<title>Test fullscreen</title>
<style>
html, body {
margin: 0;
padding: 0;
@zhuzhuaicoding
zhuzhuaicoding / semaphore.js
Created October 30, 2012 14:43 — forked from ricardobeat/semaphore.js
simple semaphore for parallel async execution, with error handling.
function queue(name){
queue.q[name]++ || (queue.q[name] = 1);
return function(err){
if (err && queue.e[name]) queue.e[name](err);
else if (err) throw err;
process.nextTick(function(){
queue.q[name]--;
queue.check(name);
});
}
@zhuzhuaicoding
zhuzhuaicoding / position-fixed.css
Created October 27, 2012 01:18 — forked from subtleGradient/position-fixed.css
Make position:fixed work in IE6
/*Make position:fixed work in IE6!*/
.fixed-top /* position fixed Top */{position:fixed;bottom:auto;top:0;}
.fixed-bottom /* position fixed Bottom */{position:fixed;bottom:0;top:auto;}
.fixed-left /* position fixed Left */{position:fixed;right:auto;left:0;}
.fixed-right /* position fixed right */{position:fixed;right:0;left:auto;}
* html,* html body /* IE6 Fixed Position Jitter Fix */{background-image:url(about:blank);background-attachment:fixed;}
* html .fixed-top /* IE6 position fixed Top */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
* html .fixed-right /* IE6 position fixed right */{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}
@zhuzhuaicoding
zhuzhuaicoding / LICENSE.txt
Created August 28, 2012 01:55 — forked from jed/LICENSE.txt
use anchor tags to parse URLs into components
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@zhuzhuaicoding
zhuzhuaicoding / feedback.md
Created March 26, 2012 10:19
Feedback to "Async Javascript"

HI Trevor Burnham:

I'm a reader of your Async JavaScript book, I bought it on 23rd March and finished it on 26rd March, it is really a treasure to me, probably the best book about async programming in JavaScript I have ever read.

After finished this book, I found there are a few problems, as well as a set of my questions, exists, so I wrote this mail to you, expecting you could give a brief look.

Since I'm not a native English speaker, my English is really poor, so if there is any ambiguousness, please feedback to me so I could have a change to state it more clearly.

Fist of all, I would like to list 9 problems I found in this book, most of which are produced by the difference between our perspectives, so feel free is you don't think they are problems.

@zhuzhuaicoding
zhuzhuaicoding / jquery.ba-tinypubsub.js
Created March 2, 2012 23:15 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);