Skip to content

Instantly share code, notes, and snippets.

View richardhartme's full-sized avatar

Richard Hart richardhartme

View GitHub Profile
class Report < ActiveRecord::Base
require 'csv'
def self.export_users
users = User.all
CSV.generate do |csv|
csv << %w(Created
LastSignIn
Firstname
@richardhartme
richardhartme / gist:4722644
Created February 6, 2013 13:56
Git Stats
git log --author="Anuj Dutta" --pretty=tformat: --numstat | awk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -
@richardhartme
richardhartme / gist:4715120
Created February 5, 2013 15:25
make ycm_core
[~/ycm_build]$ make ycm_core [ruby-1.9.3-p286]
Scanning dependencies of target BoostParts
[ 0%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/date_generators.cpp.o
[ 1%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/greg_month.cpp.o
[ 2%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/greg_weekday.cpp.o
[ 3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/gregorian_types.cpp.o
[ 3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/posix_time/posix_time_types.cpp.o
[ 4%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/exception/src/clone_current_exception_non_intrusive.cpp.o
[ 5%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/codecvt_error_category.cpp.o
[ 6%] Building CXX o
@richardhartme
richardhartme / gist:4451166
Created January 4, 2013 09:21
Solr Monit
START_COMMAND="java -Dsolr.data.dir=/solr8983 -Djetty.port=8983
-DSTOP.PORT=8079 -DSTOP.KEY=solrprod -Xms512M -Xmx1024M -jar start.jar"
STOP_COMMAND="java -Dsolr.data.dir=/solr8983 -Djetty.port=8983
-DSTOP.PORT=8079 -DSTOP.KEY=solrprod -Xms512M -Xmx1024M -jar start.jar
--stop"
start() {
echo -n "Starting $NAME"
cd $SOLR_HOME
rm -f /solr8983/index/lucene-*-write.lock
ps x -o pid,command | grep postgres | grep "newstrapper_development" | awk '{print $1}' | xargs kill
"->" (random points)
"o" (random points)
"[ ]" (thing I need to do)
"[/]" (thing I need to do, in progress)
"[?]" (I don't know what to do, might revisit)
"[-]" (Not going to do this one, maybe it became redundant)
Intel Core i7-3770K 3.50GHz (Ivybridge) Socket LGA1155 Processor (77W) - OEM £212.49 1 £212.49
EVGA GeForce GTX 570 Classified 1280MB GDDR5 PCI-Express Graphics Card with FREE Borderlands 2 PC Game £199.99 1 £199.99
Gigabyte Z77X-UD5H Intel Z77 (Socket 1155) DDR3 Motherboard £144.99 1 £144.99
OCZ Vertex 4 256GB 2.5" SATA 6Gb/s Solid State Hard Drive (VTX4-25SAT3-256G) - With FREE BattleField 3 PC (Retail) £141.66 1 £141.66
OCZ Vertex 4 128GB 2.5" SATA 6Gb/s Solid State Hard Drive (VTX4-25SAT3-128G) £74.99 1 £74.99
OCZ ZS Series 750W '80 Plus Bronze' Power Supply £60.82 1 £60.82
Fractal Design Define R4 Midi Tower Case - Black Pearl £74.99 1 £74.99
GeIL Dragon 8GB (2x4GB) DDR3 PC3-12800C11 1600MHz Dual Channel Kit (GD38GB1600C11DC) £33.29 2 £66.58
Cooler Master Hyper 612S CPU Cooler (Socket LGA1366/1156/1155/775/AM3/AM2+/AM2) £27.49 1 £27.49
Corsair Flash Voyager GT 16GB USB3.0 Flash Drive (CMFVYGT3-16GB) £18.29 1 £18.29
<form action="/" method="post">
<div class="row">
<div class="span6">
<div class="row">
<div class="span4"><input type="text" class="span4" name="" placeholder="Store Name"></div>
<div class="span2"><input type="text" class="span2" name="" placeholder="Store #"></div>
</div>
</div>
<div class="span6">
<div><input type="text" class="span6" name="" placeholder="Address"></div>
RestClient.post "https://api.hipchat.com/v1/rooms/message", {:auth_token => "XXX", :room_id => "Dev", :from => "Troll", :message => "Problem? (troll)", :message_format => "text"}
@richardhartme
richardhartme / gist:2659704
Created May 11, 2012 13:40 — forked from theozaurus/gist:716974
foobar.conf
# Enable upload_progress module for easy cross browser progress bar support
# using only javascript client side
upload_progress foobar_uploads 1m;
server {
# We only need one server block to deal with HTTP and HTTPS
# avoids duplication
listen 80;
listen 443 default ssl;