Skip to content

Instantly share code, notes, and snippets.

@aisipos
aisipos / jitbit.py
Last active March 28, 2026 12:13
My solutions to jitbit's SQL interview questions:http://www.jitbit.com/news/181-jitbits-sql-interview-questions/Uses SQLAlchemy to populate a sqlite DB with random data to try out the queries with.
"""
A module to populate a DB schema using sqlalchemy for the problems on this webpage:
http://www.jitbit.com/news/181-jitbits-sql-interview-questions/
Questions and my answers:
-- List employees (names) who have a bigger salary than their boss
select e.name from Employees as e
join Employees as b on e.BossId = b.EmployeeID
where e.Salary > b.Salary
@zyxar
zyxar / exercise.tour.go
Last active April 17, 2026 15:45
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@ijt
ijt / http_get.go
Last active March 6, 2026 11:35
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@5thWall
5thWall / unicorn
Created February 5, 2011 22:10
/etc/init.d script for unicorn and non-rails app
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by 5thWall@gmail.com http://github.com/5thWall
# based on https://gist.github.com/504875 by http://github.com/jaygooby
#
## A sample /etc/unicorn/my_app.conf
##
@mnutt
mnutt / Instrument Anything in Rails 3.md
Created September 6, 2010 06:50
How to use Rails 3.0's new notification system to inject custom log events

Instrument Anything in Rails 3

With Rails 3.0 released a few weeks ago I've migrated a few apps and I'm constantly finding useful new improvements. One such improvement is the ability to log anything in the same way that Rails internally logs ActiveRecord and ActionView. By default Rails 3 logs look slightly spiffier than those produced by Rails 2.3: (notice the second line has been cleaned up)

Started GET "/" for 127.0.0.1 at Mon Sep 06 01:07:11 -0400 2010
  Processing by HomeController#index as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
  CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1

Rendered layouts/_nav.html.erb (363.4ms)