Skip to content

Instantly share code, notes, and snippets.

View littleq0903's full-sized avatar
🎱
Wanna see some magic?

CoColin littleq0903

🎱
Wanna see some magic?
View GitHub Profile
@qingfeng
qingfeng / models.py
Created May 16, 2010 14:23
Django Image Field UnitTest
from django.db import models
class M1(models.Model):
title = models.CharField(max_length=100)
img1 = models.ImageField(upload_to="static/")
def __unicode__(self):
return self.title
@demonbane
demonbane / makeapp.sh
Created July 5, 2011 20:05
Create a Fluid-style app launcher for single-window Chrome instances on OSX
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"
@lotem
lotem / squirrel.custom.yaml
Last active November 5, 2024 01:13
【鼠鬚管】定製檔
# 適用於【鼠鬚管】0.9.13+
# 位置:~/Library/Rime/squirrel.custom.yaml
# 用法:想要哪項生效,就刪去該行行首的#字符,但注意保留用於縮進的空格
patch:
# us_keyboard_layout: true # 鍵盤選項:應用美式鍵盤佈局
# show_notifications_when: growl_is_running # 狀態通知,默認裝有Growl時顯示,也可設爲全開(always)全關(never)
# style/horizontal: true # 候選窗横向顯示
# style/inline_preedit: false # 非內嵌編碼行
# style/font_face: "儷黑 Pro" # 我喜歡的字體名稱
@diyan
diyan / gist:2850866
Created June 1, 2012 09:54
Python with PowerShell Remoting (Windows equivalent for Unix ssh sessions)
# Note that target_env.login and target_env.password is global variables
# Maybe I should add this into Fabric project (http://docs.fabfile.org/en/1.4.2/index.html).
# This is complicated task for sure but it would be nice if Fabric could use ssh under Linux and PowerShell Remoting under Windows.
def remote_sh(target_host, command_text, ignore_error=False):
print('run PowerShell script block at {0}: {1}'.format(target_host, command_text))
command_text = command_text.replace('"', '\'')
@lotem
lotem / default.custom.yaml
Last active October 23, 2024 10:07
使用 Control 鍵切換中西文,上屏已輸入的編碼;令 Caps Lock 改變字母的大小寫
# 中西文切換鍵的默認設置寫在 default.yaml 裏面
# 以下的 default.custom.yaml 在全局範圍重定義該組快速鍵
#
# 可用的按鍵有 Caps_Lock, Shift_L, Shift_R, Control_L, control_R
# Mac 系統上的鼠鬚管不能區分左、右,因此只有對 Shift_L, Control_L 的設定起作用
#
# 已輸入編碼時按切換鍵,可以進一步設定輸入法中西文切換的形式。
# 可選的臨時切換策略有三:
# inline_ascii 在輸入法的臨時西文編輯區內輸入字母、數字、符號、空格等,回車上屏後自動復位到中文
# commit_text 已輸入的候選文字上屏並切換至西文輸入模式
@P4
P4 / default.reg
Last active October 5, 2024 01:35
Color schemes for Windows Command Prompt
Windows Registry Editor Version 5.00
; Default color scheme
; for Windows command prompt.
; Values stored as 00-BB-GG-RR
[HKEY_CURRENT_USER\Console]
; BLACK DGRAY
"ColorTable00"=dword:00000000
"ColorTable08"=dword:00808080
; BLUE LBLUE
@georgefs
georgefs / copy.vim
Created September 14, 2013 16:12
ubuntu vim copy
python import gtk
python import vim
vmap <silent> <C-C> y:let @0=substitute(@0,"\\","\\\\\\","gi")<CR>:let @0=substitute(@0,"\'","\\\\'","gi")<CR>:python gtk.clipboard_get().set_text('''<C-R>0''')<CR>:python gtk.clipboard_get().store()<CR>
@lucemia
lucemia / gist:7262390
Created November 1, 2013 08:24
html snippet
<iframe frameBorder="0" scrolling="no" width="300" height="250" marginwidth="0" marginheight="0" style="display: visible" src="http://ad.tagtoo.co/ad_g_300x250?pb=66&id=4#q=http%3A%2F%2Fwww.mayuki.com.tw%2F&p=%%SITE%%&cachebuster=%%CACHEBUSTER%%&click=%%CLICK_URL_ESC%%"></iframe>
# Use a custom dictionary.
patch:
translator/dictionary: terra_pinyin.mine
@darthwalsh
darthwalsh / MinimalCSharp.md
Last active August 25, 2022 21:55
Minimal C# .NET Framework project - CS CSPROJ SLN

Note, this is for .NET Framework! Nowadays you probably want to use dotnet new cli to make a dotnet core project.

If you've ever started a simple C# project in Visual Studio, it creates a lot of cruft in your project.

These are a minimal set of files that you can start writing a C# programs. I deleted most lines from a starter CSPROJ and SLN file to get this starter template.

These files open and build cleanly in:

  • msbuild
  • Visual Studio
  • Visual Studio Code