Skip to content

Instantly share code, notes, and snippets.

View chakrit's full-sized avatar

Chakrit Wichian chakrit

View GitHub Profile
function spawnLs() {
function innerSpawnLs(arg) {
// spawns ls + args, then use callback:
function() {
setTimeout(innerSpawnLs, 0, newArg);
}
}
setTimeout(innerSpawnLs, 0, firstArg);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web.Mvc;
using System.Web.Routing;
namespace MyApp
{
*2
$6
SELECT
$1
0
*3
$3
SET
$4
test
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
private Size shrinkSize(Size origSize)
{
const int maxWidth = 900;
const int maxHeight = 700;
const double flipRatio = (double)maxWidth / maxHeight;
if (origSize.Width < maxWidth &&
origSize.Height < maxHeight)
return origSize;
import java.util.Timer;
import java.util.TimerTask;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.AttributeSet;
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4952
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@chakrit
chakrit / program.cs
Created October 26, 2010 22:58
Some of the best features that came with LINQ that isn't related to databases.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace DummyConsole
{
internal unsafe class Program
{
@chakrit
chakrit / leak.txt
Created October 28, 2010 06:43
The VBTeam leaked information about
[Placeholder]
We're very happy to announce today the Async CTP for Visual Basic and C#.
Async CTP homepage: http://msdn.com/vstudio/async
Installer: http://go.microsoft.com/fwlink/?LinkId=203690
Async discussion forums: http://social.msdn.microsoft.com/Forums/en-US/async/threads
Asynchronous programming is something that helps make your UI more responsive, especially in applications that interact with databases or network or disk. It's also used to make ASP servers scale better.
Until now, asynchronous programming has also been prohibitively hard, "not worth the investment"-hard. But with the Async CTP we've made asynchronous programming easy enough that developers should routinely consider asynchrony for most of their applications.
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command signup
prompt: username: chakrit
error: Username was already taken
prompt: username: chakritw
prompt: email: *********@chakrit.net
prompt: password:
prompt: confirm password:
error: Error running command signup