Skip to content

Instantly share code, notes, and snippets.

View surrealist's full-sized avatar
🐌
a life.

Suthep Sangvirotjanaphat surrealist

🐌
a life.
View GitHub Profile
@surrealist
surrealist / test1.cs
Created November 12, 2010 15:48
test 1
var x = 10;
@surrealist
surrealist / gist:674253
Created November 12, 2010 15:52
jQuery building block
<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
// 1
// place your code here
});
// ]]>
</script>
@surrealist
surrealist / css -> clearfix
Created March 20, 2012 13:41 — forked from djanix/css -> clearfix
Clear after a float element for all browser and without addid aditionnal markup in the html
.clearfix:before,
.clearfix:after {
content: '\0020';
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
@surrealist
surrealist / gist:2507505
Created April 27, 2012 08:39
gfx_GetItemCreate
[HttpPost]
public ActionResult gfx_GetItemCreate(string parentKeys) {
TViewModel item = new TViewModel();
InitialNewItem(ViewData, item, parentKeys);
SetViewDataForCreate(ViewData, item);
return PartialView(ViewName_ItemCreate, item);
}
@surrealist
surrealist / gist:2606745
Created May 6, 2012 01:09
1+2+3+...+100=?
// 1
int sum = 0;
for(int i=1; i<=100; i++) {
sum += i;
}
// 2
int sum = Enumerable.Range(1, 100).Sum();
@surrealist
surrealist / training-room-requirements.md
Created May 9, 2012 15:06
GreatFriends.Biz Training Room Requirements

Please prepare training room to meet this requirements:

  1. LCD projector
  2. Whiteboard (must not use as the projector screen) or Visualizer
  3. Microphone / Speaker
  4. Wired LAN for each students and one for me. (Wireless LAN is not work for my clipboard sharing program)
  5. Each student should has their own PC or notebook.
  6. Internet connection is not required but preferred.
@surrealist
surrealist / UnitTestHelper.cs
Created May 13, 2012 02:13
DIY Assert.Throw from NerdDinner project
using System;
using NUnit.Framework;
namespace NerdDinner.Tests {
public static class UnitTestHelper {
public static TException AssertThrows<TException>(Action action) where TException : Exception {
try {
action();
}
catch (TException e) {
@surrealist
surrealist / .gitignore
Created May 28, 2012 15:59
File .gitignore from GitHub for Windows
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/**
tmp/**
@surrealist
surrealist / .gitattributes
Created May 28, 2012 16:02
File .gitattributes from GitHub for Windows
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
@surrealist
surrealist / SubjectFacts.cs
Created June 4, 2012 04:51
Gist of my unit testing for a property
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using GF.Web.Models;
using System.ComponentModel.DataAnnotations;
namespace GF.Web.Tests.Models {