Skip to content

Instantly share code, notes, and snippets.

@terryh
terryh / sse.go
Created December 10, 2019 01:44 — forked from ismasan/sse.go
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
#!/bin/bash
# +----------------------------------------------------------------------+
# | |
# | Mount the root file system / with the option noatime |
# | |
# | By Philipp Klaus <http://blog.philippklaus.de> |
# | Tip found on <http://blogs.nullvision.com/?p=275> |
# | |
# +----------------------------------------------------------------------+
Bundle 'digitaltoad/vim-jade'
Bundle 'hallettj/jslint.vim'
Bundle 'maksimr/vim-jsbeautify'
Bundle 'mattn/zencoding-vim'
@terryh
terryh / gopm
Created February 7, 2013 15:51
simple proxy command to ack like npm for node.js.
#!/bin/bash
# Uasge:
# gopm get some package from github
# gopm run yourmain.go
export GOPATH=$PWD
go $*
"colorscheme desert
set mouse+=a
UnBundle 'myusuf3/numbers.vim'
UnBundle 'airblade/vim-gitgutter'
"UnBundle 'tpope/vim-fugitive'
UnBundle 'Lokaltog/powerline'
autocmd FileType html set ft=htmldjango.html shiftwidth=2 tabstop=2 softtabstop=2 expandtab
source /etc/bash_completion.d/git
GITPS1='$(__git_ps1 " (%s)")'
case "$TERM" in
xterm*|rxvt*)
#PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]"
PS1="$PS1${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]${GITPS1}\$"
;;
*)
@terryh
terryh / models_and_search_indexes.py
Created March 16, 2011 15:08
Example models.py file for djang-haystack
# models.py
from django.db import models
from django.contrib.auth.models import User
import datetime
class Ejournal(models.Model):
user = models.ForeignKey(User)
package {
/*
TerryH, terryh.tp at gmail.com
license: free to use at no warranty
*/
import flash.external.ExternalInterface;
public class Debug {
public static var enabled:Boolean = true;
<source-path>
<path-element>src</path-element>
<path-element>lib</path-element>
</source-path>
<external-library-path>
<path-element>${flexlib}/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
</external-library-path>
<!-- Turn on writing of generated/*.as files to disk. These files are generated by -->
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>LiHei Pro</family>
<family>MingLiU</family>
<family>PMingLiU</family>
</prefer>