Skip to content

Instantly share code, notes, and snippets.

$OutputEncoding = New-Object -typename System.Text.UTF8Encoding
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding
@superbrothers
superbrothers / ansi-color.php
Created August 23, 2012 01:49
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";
@demouth
demouth / gist:3217440
Created July 31, 2012 14:32
mb_strwidth on JavaScript
;(function(ns){
/**
* mb_strwidth
* @param String
* @return int
* @see http://php.net/manual/ja/function.mb-strwidth.php
*/
var mb_strwidth = function(str){
var i=0,l=str.length,c='',length=0;
for(;i<l;i++){
#/bin/sh
# this script greps .rb files on the the current directory recursively for a word displaying the line, line number and file path.
# greps recursively ruby files and displaing lines
grep -r -n --include="*.rb" $1 . |
# strip white spaces
tr -d ' '|
@rajiv-singaseni
rajiv-singaseni / MainActivity.java
Created July 6, 2011 21:19
An android activity which demonstrates picking a photo from gallery and uploading it to a remote server.
package com.webile.upload;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.InputStreamReader;
import java.util.Date;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;