This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin | |
export PATH=/usr/local/ffmpeg-6.1-amd64-static:$PATH | |
alias pbcopy='xclip -selection clipboard' | |
alias pbpaste='xclip -selection clipboard -o' | |
open() { | |
nautilus $1 & | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numpy_code = """ | |
# -*- coding: utf-8 -*- | |
# Copyright (c) 2014, Almar Klein and Wade Brainerd | |
# tinynumpy is distributed under the terms of the MIT License. | |
# | |
# Original code by Wade Brainerd (https://github.com/wadetb/tinyndarray) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/credentials" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/dynamodb" | |
"github.com/pkg/errors" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
function killport { | |
while true; do | |
PID=$(lsof -i TCP:$1 | grep LISTEN | awk '{print $2}') | |
exec 3>&2 # 3 is now a copy of 2 | |
exec 2> /dev/null # 2 now points to /dev/null | |
kill $PID | |
kill -0 $PID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"os" | |
"os/exec" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"html/template" | |
"net/http" | |
"code.google.com/p/go.tools/present" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
m := `package main | |
import "fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void floatTextureExperiment | |
{ | |
GLenum err = 0; | |
GLuint texture1; | |
glGenTextures(1, &texture1); | |
glActiveTexture(GL_TEXTURE1); | |
glBindTexture(GL_TEXTURE_2D, texture1); | |
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | |
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | |
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# profile.rb - A script that analyzes the memory usage of a redis instance from it's "dump.rdb" | |
# | |
# To run this script, edit the key_groups variable in the stats method, and then run | |
# `ruby profile.rb dump.rdb` in the command line. | |
# Running this script will: | |
# * Dump the contents of the input rdb file in CSV format to "/tmp/memory.csv" | |
# * Load the contents of "/tmp/memory.csv" to the table "mem" in the "redis_mem" database | |
# * Print the stats of each key group to STDOUT | |
# | |
# Dependencies: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Haproxy config file for SSL and basic authentication | |
# | |
# Since ssl is needed, we need to use | |
# `make TARGET=linux26 USE_OPENSSL=1 ADDLIB=-lz` to install haproxy. | |
# Also, haproxy version must be haproxy-1.5-dev19 or above. | |
# | |
# An example curl command that queryies pic-collage.com/api/collages/feed is | |
# `curl -k -v -u 'collages:password' 'https://ec2-ip.compute-1.amazonaws.com/api/collages/feed'` | |
userlist collages_dyno |
NewerOlder