Skip to content

Instantly share code, notes, and snippets.

@codler
codler / gist:1323293
Created October 28, 2011 19:40 — forked from fat/gist:1217433
tabs with history support
/* ========================================================
* bootstrap-tab.js v2.0.1 modified r1
* http://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@codler
codler / gist:1024805
Created June 14, 2011 12:30
Screen capture
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
using System.Runtime.InteropServices;
// Made By Han Lin Yap 2011-03-03
public class screen_capture
@codler
codler / gist:906181
Created April 6, 2011 18:10
relative_date
/**
* Convert to relative date
*
* @param int $timestamp In seconds
* @param array $settings
* @param string $default_format
* @return string
* @version 1.0 (2011-12-12)
*/
function relative_date( $timestamp, array $settings = array(), $default_format = 'Y-m-d' ) {
@codler
codler / gist:845809
Created February 27, 2011 01:18
wget.exe
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;
public class wget
{
# -*- encoding: utf8 -*-
#
# Simple WebSockets in Python
# By Håvard Gulldahl <[email protected]>
#
# Based on example by David Arthur (he did all the hard work :)
# https://gist.github.com/512987
#
import struct
@codler
codler / gist:645911
Created October 25, 2010 22:21
Javascript Regex
// strip multiline comment
.replace(/\/\*((?:[^\*]|\*[^\/])*)\*\//g, '')