Skip to content

Instantly share code, notes, and snippets.

@nofxx
nofxx / Rakefile
Created November 13, 2014 03:20
C++/Cpp Rakefile with includes, links... OpenCV example
#
# CPP Rakefile
#
EXEC = "square" # Your app executable
FLAGS = "-Wall -Wextra" # Flags for building
EXTRA = %w{ OpenCV } # Extra includes
#
# Nothing to see here, move along...
#
@nofxx
nofxx / ffemacs
Last active December 25, 2015 13:59
firefox + better errors + emacs => click to fix error!
#!/usr/bin/env ruby
chunk = ARGV.join
head, line = chunk.split("&line=")
trash, file = head.split("file://")
file = file.gsub!("%2F", "/")
args = `ps aux | grep emac[s]` == "" ? "c" : ""
@nofxx
nofxx / logstash.conf
Last active December 24, 2015 13:49
Centralized Ruby/Rails/MongoDB/Redis/Sidekiq/Elasticsearch/Haproxy/PG/OS -> syslog-ng -> logstash -> elasticsearch -> kibana =D
#
# Logstash conf!
#
input {
tcp {
host => "0.0.0.0"
port => 514
type => syslog
}
udp {
@nofxx
nofxx / bootstrap.tabfix.coffee
Last active December 24, 2015 04:39
Fix bootstrap tabs! Go back in F5/reload/etc
#
# Fix bootstrap tabs! Go back in F5/reload/etc
#
doc.on 'created', '.tab-fix', ->
hash = document.location.hash;
if (hash)
$(@).find("a[href='#{hash}']").tab('show')
for link in $(@).find('a')
do (link) ->
@nofxx
nofxx / .conkyrc
Created December 11, 2012 05:49
Conky for intel X79/it87
#
# xConky settings
#
update_interval 2
total_run_times 0
net_avg_samples 1
cpu_avg_samples 2
imlib_cache_size 0
@nofxx
nofxx / resque.rake
Created February 9, 2012 10:25
Resque syslog (via log4r)
require 'log4r'
require 'log4r/outputter/syslogoutputter'
require 'resque/failure/multiple'
require 'resque/failure/redis'
module Resque
module Failure
class Syslog < Base
# Define your logger, change as needed.
@nofxx
nofxx / barcode.rgin
Created November 1, 2011 17:00
RGhost Tests
(type.ps) runlibfile
(unit.ps) runlibfile
(IsoLatin.enc) runlibfile
/default_encoding IsoLatin def
<< /Duplex false /Tumble false >> setpagedevice
/pagesize [595 842] def
/margin 3 dict def margin begin /top 1 cm def /right 1 cm def /bottom 1 cm def /left 1 cm def end
(paper.ps) runlibfile
[ /Producer (Ruby Ghostscript - RGhost v0.8.7) /DOCINFO pdfmark /rows_per_page 80 def /count_pages 10 def /row_height 0.4 cm def /row_padding 0.1 cm def (basic.ps) runlibfile
(cursor.ps) runlibfile
@nofxx
nofxx / c
Created October 19, 2011 04:42
rc1
main()
int x = 1;
float y = 22.5;
char c = 'C';
char[] = "Take this " + c + "!";
printf("x to i: %d\n", x);
@nofxx
nofxx / project_default_scope_mongoid.rb
Created October 19, 2011 03:41
Mongoid bug default_scope test
require 'mongoid'
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db("foo_#{Time.now.to_i}")
end
class Project
include Mongoid::Document
field :name
field :state, :default => 'active'
@nofxx
nofxx / rspec_spec.rb
Created October 15, 2011 08:17
Spork on Rails 3/ActiveRecord/Fabrication
require 'spork'
Spork.prefork do
ENV['RAILS_ENV'] ||= 'test'
require 'rails/application'
Spork.trap_method(Rails::Application::RoutesReloader, :reload!)
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'database_cleaner'