Skip to content

Instantly share code, notes, and snippets.

View shazron's full-sized avatar
😆

Shazron Abdullah shazron

😆
View GitHub Profile
@pmuellr
pmuellr / ApacheCon-cities.txt
Created February 21, 2012 23:27
list of ApacheCon cities
ApacheCon NA 2011 - Vancouver
ApacheCon NA 2010 - Atlanta
ApacheCon US 2009 - Oakland
ApacheCon EU 2009 - Amsterdam
ApacheCon US 2008 - New Orleans
ApacheCon EU 2008 - Amsterdam
ApacheCon US 2007 - Atlanta
ApacheCon EU 2007 - Amsterdam
ApacheCon US 2006 - Austin
ApacheCon AP 2006 - Colombo, Sri Lanka
@janeylicious
janeylicious / quora.css
Created August 17, 2012 00:03
quora deblur css
/*
unfortunately webkit doesn't support @document yet afaik
so you will need something like http://code.grid.in.th
to have per-website stylesheets (if you care about that).
Since I use that extension, I have no idea how well this
works if you use it as a generic user stylesheet in Safari.
I spent all of ten minutes looking for what to change and
to test on the few pages that were blurred, and it mostly
works. YMMV. This obviously doesn't work if Quora doesn't
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@foozmeat
foozmeat / openssl-build.sh
Last active May 22, 2024 17:56
A shell script to build openssl for iOS and Mac. It currently builds: Mac -> i386 & x86_64 // iOS -> armv7, arm64 // iOS Simulator -> i386 & x86_64.
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
@pmeenan
pmeenan / user-timing-rum.js
Last active January 18, 2024 23:46
Support routine for adding W3C user timing events to a site. Includes some basic polyfill support for browsers that don't support user timing or navigation timing (though the start time for non-navigation timing support could be improved with IE < 9 to use IE's custom start event).
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
@robmathers
robmathers / readinglisturls.py
Last active November 16, 2023 21:18
Prints out URLs of items in Safari’s Reading List
#!/usr/bin/env python
import plistlib
from shutil import copy
import subprocess
import os
from tempfile import gettempdir
import sys
import atexit
BOOKMARKS_PLIST = '~/Library/Safari/Bookmarks.plist'
anonymous
anonymous / index.html
Created July 17, 2013 20:13
A CodePen by Captain Anonymous. Switches - The first 2 are designed with depth and lighting, while the 3rd one is flatly designed with a somewhat "gooey"-ish transition on it.
<div class="wrap">
<input type="checkbox" id="s1" />
<label class="slider-v1" for="s1"></label>
<input type="checkbox" id="s2" checked="" />
<label class="slider-v1" for="s2"></label>
</div><!--/wrap-->
<div class="wrap">
@steipete
steipete / UIKitLegacyDetector.m
Last active March 12, 2024 13:57
A simple way to detect at runtime if we're running in UIKit legacy mode or the new "flat" variant. Written for our PDF iOS SDK (http://pspdfkit.com), where the precompiled binary needs to detect at runtime in what variant it's running. Want more stuff like that? Follow me on Twitter: http://twitter.com/steipete
// Taken from http://PSPDFKit.com. This snippet is under public domain.
#define UIKitVersionNumber_iOS_7_0 0xB57
BOOL PSPDFIsUIKitFlatMode(void) {
static BOOL isUIKitFlatMode = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7.
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0;
}
@isaacs
isaacs / cla-response.md
Last active September 26, 2017 18:08
Occasionally people get upset at being asked to sign a standard Apache-style CLA to contribute code to a project. This is my response. Please feel free to copy/remix/etc any or all of it regarding your own project if you like, and let me know in the comments if you have any feedback, especially if something in here is unreasonable or incorrect. …

Caveat: I am not a lawyer.

I understand that asking you to give up ownership of something may sound weird or pushy. Legal documents are scary, and can be fraught with unintended consequences if they're entered into lightly. I hope that I can shed some light on why a project would do so, since I've been through this with several projects I maintain.

You need to permit sublicensing and re-licensing so that if you die, the project doesn't have to track down your heirs to sign off on any license changes. (Sadly not an unrealistic or particularly uncommon situation.) Remember, IP laws do change, sometimes in ways that change the spirit of licenses, or make them insufficient or suboptimal to protect the freedoms that they were designed to protect. That's why licenses like the BSD 2-clause and ISC exist, because earlier licenses were no longer ideal for OSS projects using them.

It is completely reasonable for the project to require that you agree to give them – actually give them, all the way, without res

@steipete
steipete / Macros.h
Last active January 6, 2024 07:24
Declare on your main init that all other init methods should call. It's a nice additional semantic warning. Works with Xcode 5.1 and above. Not tested with earlier variants, but should just be ignored. A reference to this macro shortly appeared in https://developer.apple.com/library/ios/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObj…
#ifndef NS_DESIGNATED_INITIALIZER
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer))
#else
#define NS_DESIGNATED_INITIALIZER
#endif
#endif