Skip to content

Instantly share code, notes, and snippets.

View wlaurance's full-sized avatar
🎯
Focusing

Will Laurance wlaurance

🎯
Focusing
View GitHub Profile
@wlaurance
wlaurance / sites-available-default
Created May 5, 2014 19:22
Nginx server snippet
server{
server_name examplehost1.com;
rewrite ^/(.*) http://www.examplehost1.com permanent;
}
server{
server_name blog.examplehost1.com;
rewrite ^/(.*) http://www.examplehost1.com permanent;
}
server{
server_name www.examplehost1.com;
function fn() {
try {
fn()
} catch(e) {
console.log(e)
return 'overflow'
}
}
fn()
@wlaurance
wlaurance / timer.md
Last active August 29, 2015 14:00
Timer thoughts

I don't like a timer staring me in the face.

I like to know when I've hit points in time. Like every 30 mins, 1 hour, or a predefined time. (cater to pomodoro peeps)

I need a soft indication that the time is running. A green/pictorial to indicate the timer is running.

I want a count down timer too. This is general purpose. I have an over timer on right now and it is quiet. But sometimes this is nice for features. "I will pay you one hour to research said topic", exclaimed the client. For situations like this, it would be cool.

@wlaurance
wlaurance / revel.txt
Created April 23, 2014 11:09
Go Revel
fixup
@wlaurance
wlaurance / gist:11192095
Created April 22, 2014 19:51
Take that java
public String buildImageURL(String path) {
return
new Uri.Builder()
.scheme(scheme)
.authority(hostname)
.appendEncodedPath(base)
.appendEncodedPath(path)
.build().toString();
}
@wlaurance
wlaurance / resources.md
Created April 20, 2014 23:19
Gearing up for a Android Clojure Project
@wlaurance
wlaurance / time-entries-for-project.coffee
Created April 16, 2014 16:30
time entries for project
getForProject: (projectId, callback)->
statement = @time_entry.select @time_entry.star()
.from @time_entry
.where @time_entry.projectId.equals projectId
@wlaurance
wlaurance / time-entries-sql.coffee
Created April 16, 2014 16:21
time entries node-sql define statement
time_entries = sql.define
name: 'time_entries'
columns: ['message', 'projectId', 'userId', 'start', 'end', 'duration', 'id']
@wlaurance
wlaurance / transaction-ex.coffee
Last active August 29, 2015 13:59
tempus db transaction consumer
deleteOne: (key, callback)->
{time_entry} = TimeEntriesController
deleteProjectTimeEntries = time_entry.delete().where(time_entry.projectId.equals(key))
deleteProject = @project.delete().where(@project.id.equals(key))
deleteUsersProjectsRows = @usersprojects.delete().where(@usersprojects.projectId.equals key)
t = @transaction()
start = ->
async.eachSeries [deleteProjectTimeEntries, deleteUsersProjectsRows, deleteProject],
(s, cb)->
t.query s, (err)->
@wlaurance
wlaurance / tempus-db-index.coffee
Created April 15, 2014 21:54
tempus db index
pg = require 'pg'
{dev} = require "#{__dirname}/../database"
devConfig = "postgres://#{dev.user}:#{dev.password}@localhost/#{dev.database}"
constring = process.env.HEROKU_POSTGRESQL_NAVY_URL or process.env.TRAVIS_DB_URL or devConfig
{EventEmitter} = require 'events'
Database = (callback) ->
pg.connect constring, callback