Skip to content

Instantly share code, notes, and snippets.

View hyeomans's full-sized avatar
🏠
Working from home

Hector Yeomans hyeomans

🏠
Working from home
View GitHub Profile
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@hyeomans
hyeomans / graceful.go
Created August 20, 2017 02:30 — forked from peterhellberg/graceful.go
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@hyeomans
hyeomans / gist:f185818e4ccb1dfc0105f5b72505af45
Created September 3, 2016 04:56
Instructions for configuring lostgres for localhost:5433 access on a vagrant ubuntu lucid32 image
# bring up the vagrant box
vagrant up
=> [default] Importing base box 'lucid32'...
# ssh into the vagrant box
vagrant ssh
=> Linux lucid32 2.6.32-38-generic #83-Ubuntu SMP Wed Jan 4 11:13:04 UTC 2012 i686...
# take special note of the ip address of your host machine that ssh reports here
# in my case it is 10.0.2.2, a value that I will use later to allow connections
@hyeomans
hyeomans / windows.h__.js
Created August 26, 2016 03:34
windows.h.js INFINITY
var ffi = require('ffi'),
ref = require('ref'),
Struct = require('ref-struct'),
Library = require('./Library'),
Type = ref.Type,
NULL = ref.NULL,
isNull = ref.isNull;
var groups = ['libs', 'types', 'structs', 'callbacks', 'enums'];
# http://boxstarter.org/package/url?
#####################
# BEGIN CONFIGURATION
#####################
#region Initial Windows Config
Install-WindowsUpdate -AcceptEula
Update-ExecutionPolicy Unrestricted
; Change your hotkey here
^1::
DetectHiddenWindows, on
IfWinExist ahk_class Console_2_Main
{
IfWinActive ahk_class Console_2_Main
{
WinHide ahk_clasas Console_2_Main
WinActivate ahk_class Shell_TrayWnd
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Update-ExecutionPolicy Unrestricted
cinst IIS-WebServerRole -source windowsfeatures
cinst IIS-HttpCompressionDynamic -source windowsfeatures
cinst IIS-ManagementScriptingTools -source windowsfeatures
cinst IIS-WindowsAuthentication -source windowsfeatures
Option Infer On
Option Compare Text
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
# simple ruby code example for running python script
path_to_script = File.dirname(__FILE__)
puts "It's a ruby script"
puts "Run python script with backticks"
puts "Result is available in caller.ru"
puts `python #{path_to_script}/processing.py UserName 37`

Setup new Mac with OSX Lion from scratch

These commands are good as of 2011-07-27.

Install Xcode 4

The download/install takes a while so start it first. When it finishes downloading you will still need to run it to complete installation.

Really the nicest choice for a terminal on OSX right now, especially with Lion style full screen support.