Skip to content

Instantly share code, notes, and snippets.

View duanhong169's full-sized avatar
💭
I may be slow to respond.

Hong Duan duanhong169

💭
I may be slow to respond.
View GitHub Profile
@aemkei
aemkei / LICENSE.txt
Last active April 12, 2024 21:27 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@computerpunc
computerpunc / url-decode.html
Created April 10, 2011 19:59
Tags for url encoding/decoding in Play Framework Template Engine
#{set 'output'}#{doBody /}#{/set}${output.urlDecode().raw()}
@tomgibara
tomgibara / SquareGridLayout.java
Created November 27, 2010 01:22
Square grid layout for Android
package com.tomgibara.android.util;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
/**
* A layout that arranges views into a grid of same-sized squares.