Skip to content

Instantly share code, notes, and snippets.

View minhman's full-sized avatar

Võ Minh Mẫn minhman

View GitHub Profile
@minhman
minhman / functions.php
Created September 26, 2012 04:12
function for wordpress
<?php
include 'lang.php';
include 'meta-box.php';
add_theme_support('menus');
add_theme_support('post-thumbnails');
// add_image_size( 'full', 700, 500, false );
function get_featured_img($post_id){
@minhman
minhman / index.html
Created September 26, 2012 04:07
html5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
<meta name="author" content="Izwebz" />
<meta name="copyright" content="Licensed under GPL and MIT." />
<meta name="description" content="" />
@minhman
minhman / canPlayAudioMP3.js
Created May 21, 2012 07:54 — forked from westonruter/canPlayAudioMP3.js
HTML5 MP3 Audio detection
/**
* Detect if the browser can play MP3 audio using native HTML5 Audio.
* Invokes the callack function with first parameter is the boolean success
* value; if that value is false, a second error parameter is passed. This error
* is either HTMLMediaError or some other DOMException or Error object.
* Note the callback is likely to be invoked asynchronously!
* @param {function(boolean, Object|undefined)} callback
*/
function canPlayAudioMP3(callback){
try {
@minhman
minhman / detect.py
Created May 14, 2012 02:26 — forked from LeZuse/detect.py
Flask browser detection
browser = request.user_agent.browser
version = request.user_agent.version and int(request.user_agent.version.split('.')[0])
platform = request.user_agent.platform
uas = request.user_agent.string
if browser and version:
if (browser == 'msie' and version < 9) \
or (browser == 'firefox' and version < 4) \
or (platform == 'android' and browser == 'safari' and version < 534) \
or (platform == 'iphone' and browser == 'safari' and version < 7000) \
@charset "utf-8";
@import url("reset.css");
/* CSS Document */
body{
font-family:"UTM Duepuntozero", tahoma, arial;
background:url(images/background.jpg) repeat;
}
span{
@minhman
minhman / demo
Created May 14, 2012 02:24
Demo gist
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eg
@minhman
minhman / gist:2687018
Created May 13, 2012 08:53 — forked from padolsey/gist:527683
Js: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}