Skip to content

Instantly share code, notes, and snippets.

View tungd's full-sized avatar
🐳
Back to normal

Tung Dao tungd

🐳
Back to normal
View GitHub Profile
@tungd
tungd / ri.vim
Created December 18, 2011 16:42
vim-ref ri source
" A ref source for ri.
" Version: 0.0.1
" Author : Tung Dao <me@tungdao.com>
" Modified from pman source by soh335 <sugarbabe335@gmail.com>
" https://github.com/soh335/vim-ref-pman
" License: Creative Commons Attribution 2.1 Japan License
" <http://creativecommons.org/licenses/by/2.1/jp/deed.en>
let s:save_cpo = &cpo
set cpo&vim
@tungd
tungd / mips_learn.vim
Created March 21, 2012 08:51
Functions I used to learn Assembly language on MIPS Architecture
" Author: Tung Dao <me@tungdao.com>
" Usage: compile .c file, load generated .s file in vim,
" source this script and execute the function.
" Requires xgcc executable which comes with MipsIT
" Ex: xgcc -O3 -S -c foo.c
" vim foo.s
" In vim:
" so ~/Desktop/mips_learn.vim
" call ToMIPS()
/**
* Mootool Popup
* @author Tung Dao <me@tungdao.com>
*/
;(function(exports) {
var Popup = new Class({
initialize: function(selector) {
this.elements = $$(selector);
@tungd
tungd / twitter.user.js
Created May 15, 2012 06:13
Quick view the first link in twitter
// ==UserScript==
// @match http://twitter.com/*
// @match http://www.twitter.com/*
// @match https://twitter.com/*
// @match https://www.twitter.com/*
// ==/UserScript==
/*!
* Name: Twitter Quick View
* URL: http://tungdao.com
* Description: Add `v` keyboard shortcut to open the first link in a tweet
@tungd
tungd / .vimrc
Created June 9, 2012 17:31
UltiSnip <tab> everything
" UtilSnips
" The <tab> key works as follow
" - if there is popup: <c-n> (next popup item)
" - if there is something behind cursor
" - try expand snippet
" - if can't expand, try jump
" - finally try <c-n> (key word completion)
" The <s-tab>:
" - if there is popup: <c-p> (previous popup item)
" - try jump back
http://www.linuxquestions.org/questions/linux-desktop-74/awesome-wm-3-4-1-help-810852/
audience unsettings jupiter oracle-java7-installer fuse-exfat awesome awesome-extra
ctags vim-gtk git-core
repos:
ppa:audience-members/ppa
ppa:diesch/testing
<div class="intro-hapham">
<img class="img-intro" src="<?php echo bloginfo("template_directory"). get_post_meta($post->ID,"thumbnail_big",true) ?>" border="0" alt="<?php the_title() ?>" />
<div class="text-intro">
<h1 class="title-intro"><?php the_title() ?></h1>
<div class="bor-gra" style="width: 930px; margin:0px auto; height: 1px; background: #999999; "></div>
<div class="cont-intro">
<div class="cols">
<?php the_content(" ") ;?>
@tungd
tungd / Makefile
Created February 19, 2013 09:51
Makefile I used when learning Rust (following this tutorial: http://www.rustforrubyists.com/). Compile and run by `make [example name]/run` Compile and run as test by `make [example name]/test`
RM := rm -vf
TARGET := $(shell find . -type f -not -name "*.rs" -and -not -name "Makefile" -and -not -name ".git")
all:
@echo "Nothing to be done here"
%/run: %.rs
rustc $*.rs
./$*
@tungd
tungd / AndroidManifest.xml
Created March 10, 2013 03:17
Sample XML processing.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stockrobot"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
diff --git a/mail.php b/mail.php
index fbc1b00..2677337 100644
--- a/mail.php
+++ b/mail.php
@@ -7,9 +7,10 @@ while (!file_exists($wp_include) && $i++ < 10) {
}
require($wp_include);
- $name = iconv("UTF-8", "ISO-8859-2", $_POST['name']);
- $email = iconv("UTF-8", "ISO-8859-2", $_POST['email']);