Skip to content

Instantly share code, notes, and snippets.

View gigq's full-sized avatar

Justin Sanders gigq

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gigq on github.
  • I am gigq (https://keybase.io/gigq) on keybase.
  • I have a public key whose fingerprint is D048 7EEF 640C CF79 7859 D37E 5693 BB4A 431E 11CE

To claim this, I am signing this object:

@gigq
gigq / gist:166802
Created August 12, 2009 21:54
couchload.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'couchrest'
require 'uuidtools'
require 'benchmark'
couch = CouchRest.new("http://localhost:5984")
db = couch.database('couchload')
db.delete! rescue nil
db = couch.create_db('couchload')
Results from http://gist.github.com/166802 script.
This test is to see the performance hit on CouchDB as more rows are loaded into the database.
Specifically how long it takes to insert 1000 rows in a batch insert as the database continues to grow.
This is what I'm seeing on an EC2 small instance.
Measurements are in the number of seconds to insert that batch of 1000 into CouchDB.
(Batch 1 - 1,000 rows in DB)
1 1.02298092842102
@gigq
gigq / gist:167477
Created August 13, 2009 21:41
tokyobench.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'tokyotyrant'
require 'uuidtools'
require 'benchmark'
results = File.new("/tmp/tokyoload.csv", "w")
rdb = TokyoTyrant::RDB::new
rdb.open("localhost", 1978)
rdb.vanish
Results from http://gist.github.com/167477 script.
This test is to see the performance hit on TokyoCabinet BTree DB through TokyoTyrant
as more rows are loaded into the database.
Specifically how long it takes to insert 1000 rows one at a time as the database continues to grow.
This is what I'm seeing on an EC2 small instance.
Measurements are in the number of seconds to insert 1000 rows into TokyoCabinet.
(Batch 1 - 1,000 rows in DB)
find . -name "*.*" -exec basename '{}' \; | sort > /tmp/full
find . -name "*.*" -exec basename '{}' \; | sort | uniq > /tmp/uql
comm -3 /tmp/full /tmp/uql
Index: test/org/apache/pig/test/TestSplitCombine.java
===================================================================
--- test/org/apache/pig/test/TestSplitCombine.java (revision 0)
+++ test/org/apache/pig/test/TestSplitCombine.java (revision 0)
@@ -0,0 +1,441 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
@gigq
gigq / main.go
Created October 30, 2013 20:25
Moves redis list items from a source list to a target list one item at a time. Useful if you use lists as queues and can't rename the key because that would wipe out items in the target queue.
package main
import (
"flag"
"log"
"menteslibres.net/gosexy/redis"
"os"
"os/signal"
"time"
)
@gigq
gigq / iOS.xml
Created December 8, 2013 01:34
iOS.xml profile for Plex Media Sever. Copying this to iOS.xml and iOS-iPhone5,1.xml in Profiles allowed AC3 audio from iOS device to AppleTV 3 device. If you are running Plex on a Drobo5N then the location of these files are located in /mnt/DroboFS/Shares/DroboApps/plex/Application/Resources/Profiles
<?xml version="1.0" encoding="utf-8"?>
<Client name="iOS">
<TranscodeTargets>
<VideoProfile container="mp4" codec="h264" audioCodec="ac3,aac" context="all">
<!-- Inspired by Handbrake's profiles -->
<Setting name="VideoEncodeFlags" value="-x264opts bframes=3:cabac=1" />
</VideoProfile>
<VideoProfile protocol="hls" container="mpegts" codec="h264" audioCodec="ac3,aac,mp3" context="streaming">
<Setting name="VideoEncodeFlags" value="-x264opts bframes=3:cabac=1" />
</VideoProfile>
@gigq
gigq / gptcommit.sh
Created March 25, 2023 18:52
Quick bash script using gpt-ai (https://github.com/lmatosevic/chatgpt-cli) to read git diff and create a commit message
#!/bin/bash
git add .
# Run git diff and capture the output, excluding yarn.lock for js/ts projects
diff_output=$(git diff HEAD -- . ':(exclude)yarn.lock')
# Prepend the commit message to the diff output
commit_message="Output just a properly formatted git commit message from the following, be accurate and concise, no need to specify prefixes, don't assume why changes were made:"
full_output="$commit_message\n\n$diff_output"