Skip to content

Instantly share code, notes, and snippets.

View Superbil's full-sized avatar
:shipit:
Working in Cloud

Superbil Superbil

:shipit:
Working in Cloud
View GitHub Profile
using System;
namespace Test
{
class NullTest
{
static int? GetNullableInt()
{
return null;
}
private IEnumerable<TreeNode> getAllFileTreeNode(TreeNodeCollection nodes)
{
foreach (TreeNode f in nodes)
{
if (f.Nodes.Count > 0)
{
foreach (TreeNode subNode in getAllFileTreeNode(f.Nodes))
yield return subNode;
}
yield return f;
@Superbil
Superbil / gist:1087732
Created July 17, 2011 16:09
string copy
#include <stdio.h>
void printString(char *string)
{
int i;
for (i = 0; string[i] != '\0' ; i++) {
printf("%c",string[i]);
}
}
@Superbil
Superbil / CollectionT.cs
Created July 21, 2011 09:30
ArrayList for Serializable use
using System;
using System.Collections.Generic;
using System.Collections;
namespace Serializable
{
[Serializable]
public class CollectionT<T> : IList, ICollection, IEnumerable<T>
{
private ArrayList list;
#include <stdio.h>
template <class LType>
class Node
{
public:
LType data;
Node<LType>* pret;
Node<LType>* next;
Node(const LType &, Node<LType>* , Node<LType>*);
@Superbil
Superbil / gist:1508976
Created December 22, 2011 05:01
uploadPhoto to Google Contact
- (GDataEntryContact *)uploadPhotoWithContactService:(GDataServiceGoogleContact *)contactService contact:(GDataEntryContact *)targetContact photoData:(NSData *)photoData
{
GDataEntryBase *uploadPhotoEntry = [GDataEntryBase entry];
// file path on iOS don't need
NSString *mimeType = [GDataUtilities MIMETypeForFileAtPath:nil
defaultMIMEType:@"image/*"];
[uploadPhotoEntry setUploadMIMEType:mimeType];
[uploadPhotoEntry setUploadData:photoData];
@Superbil
Superbil / hack.sh
Last active October 2, 2015 23:07 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#

開源之道

Original transcript: http://allisonrandal.com/2012/04/15/open-source-enlightenment/

這幾年來,我慢慢覺得,我們參與開源社群,就像是在一條道路上並肩而行:這不僅讓我們成為更好的程式設計者,也讓我們通過與人合作,而成為更好的人。

您可以將它想成一條修行之道,讓身而為人的我們能夠不斷成長。接下來,我想談談我對開源世界的個人觀點,希望能與您分享。

首先,人是一切開源專案的核心。程式碼是很重要,但最核心的永遠是人。

@Superbil
Superbil / pythonrc.py
Created April 18, 2012 17:49
Auto run when python load
# use tab for auto complite
import rlcompleter, readline
readline.parse_and_bind('tab: complete')
@Superbil
Superbil / make link to xcode4.py
Last active October 6, 2015 03:27
Make XCode3 library to XCode.app