Skip to content

Instantly share code, notes, and snippets.

View snwfog's full-sized avatar
🐶
this is fine

Charles Yang snwfog

🐶
this is fine
View GitHub Profile
@snwfog
snwfog / main.go
Created December 22, 2019 03:17 — forked from wolfeidau/main.go
Epoll example in golang starting point
package main
//
// Starting point is from http://gcmurphy.wordpress.com/2012/11/30/using-epoll-in-go/
//
import (
"fmt"
"os"
"syscall"
@snwfog
snwfog / History|-14436c1a|entries.json
Last active April 16, 2022 14:04
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/snw/dev/sa-go-bidder-2/internal/bidder/agent_user.go","entries":[{"id":"sZ80.go","timestamp":1648479083532}]}
@snwfog
snwfog / http_streaming.md
Created May 11, 2017 12:33 — forked from CMCDragonkai/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@snwfog
snwfog / osx-setup.sh
Created November 26, 2016 04:29 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
@snwfog
snwfog / _test.rb
Created November 26, 2016 01:46 — forked from jcoglan/_test.rb
$VERBOSE = nil
require File.expand_path('../rooby', __FILE__)
Person = Rooby::Class.new 'Person' do
define :initialize do |name|
@name = name
end
define :name do
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@snwfog
snwfog / GistList!.md
Created October 11, 2014 17:29
Try GistList for iOS! http://gistlist.io/

##alt text GistList: TODO for coders alt text

# List available VMs
prlctl list --all
# Start a VM using its name
prlctl start UbuntuServer
# Stop the VM
prlctl stop UbuntuServer
# Pause and Resume
% ifconfig -a | grep broadcast
inet 192.168.1.241 netmask 0xffffff00 broadcast 192.168.1.255
% ping -i 5 -c 2 192.168.1.255
PING 192.168.1.255 (192.168.1.255): 56 data bytes
64 bytes from 192.168.1.241: icmp_seq=0 ttl=64 time=0.393 ms
64 bytes from 192.168.1.254: icmp_seq=0 ttl=255 time=2.511 ms (DUP!)
64 bytes from 192.168.1.65: icmp_seq=0 ttl=64 time=5.810 ms (DUP!)
64 bytes from 192.168.1.255: icmp_seq=0 ttl=64 time=7.886 ms (DUP!)
64 bytes from 192.168.1.241: icmp_seq=1 ttl=64 time=0.312 ms
sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
killall SystemUIServer
sudo chmod 755 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
killall SystemUIServer
sudo mv /System/Library/CoreServices/Search.bundle /System/Library/CoreServices/Search.bundle.bak
killall SystemUIServer
sudo mv /System/Library/CoreServices/Search.bundle.bak /System/Library/CoreServices/Search.bundle