Skip to content

Instantly share code, notes, and snippets.

@xaprb
xaprb / stylebot.css
Last active March 10, 2022 20:38
Make GMail's design less horrendous using Stylebot
#gb {
background-color: #4285f4;
box-shadow: 0 0 4px rgba(0,0,0,.14), 0 4px 8px rgba(0,0,0,.28);
}
.zA.yO {
background-color: white;
box-shadow: 0 0 4px rgba(0,0,0,.14);
}
This file has been truncated, but you can view the full file.
A
a
aa
aal
aalii
aam
Aani
aardvark
aardwolf
Aaron
@xaprb
xaprb / make-load.sh
Created November 18, 2015 19:34
A little shell script for hammering the dvdstore database on Postgres
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: $0 <iterations>"
exit 1
fi
# Display product ID, category, title, price, num orders
# ordered by top products limit 10
function top_products(){
@xaprb
xaprb / backup_github.sh
Created March 7, 2015 13:59
Shell script to back up all of an organization's GitHub repos
#!/bin/sh
LOGIN=YOURLOGIN
TOKEN=YOURTOKEN
ORG=YOURORG
DONE=0
PAGE=0
# sample output:
# "total_private_repos": 50,
@xaprb
xaprb / lowercase_string.go
Created January 8, 2015 13:20
lowercase_string.go
package main
import (
"database/sql"
"database/sql/driver"
"errors"
_ "github.com/go-sql-driver/mysql"
"log"
"strings"
)
@xaprb
xaprb / hello_mysql.go
Created January 8, 2015 12:48
hello_mysql.go
package main
import (
"database/sql"
"log"
_ "github.com/go-sql-driver/mysql"
)
func main() {
db, err := sql.Open("mysql", "root:@tcp(:3306)/test")

Keybase proof

I hereby claim:

  • I am xaprb on github.
  • I am xaprb (https://keybase.io/xaprb) on keybase.
  • I have a public key whose fingerprint is E877 C582 9D0E 5E8A 3AE1 BC4E D14D 8893 201A BAA0

To claim this, I am signing this object:

@xaprb
xaprb / Logger.asp
Created January 18, 2014 19:45
Old ASP scripts from 2004 or so; forgot what they are even for.
<script Language="VBScript" RunAt="server">
Class Logger
Private m_Name
Private m_Level
Private m_LoggerLevel
Private m_Destination
Private m_BufferOutput
Private m_Buffer
#!/usr/bin/perl
use strict;
use warnings FATAL => 'all';
use DBI;
use English qw(-no_match_vars);
use Getopt::Long;
use List::Util qw(max);
drop temporary table if exists left1;
drop temporary table if exists left2;
drop temporary table if exists right1;
drop temporary table if exists right2;
drop temporary table if exists right3;
create temporary table left1 (
col1 int unsigned not null auto_increment primary key,
col2 bit not null default 0,
col3 bit not null default 0