Skip to content

Instantly share code, notes, and snippets.

View letronje's full-sized avatar

Manoj Mathai letronje

View GitHub Profile
object App{
def main(args: Array[String]): Unit ={
val lists = List(
Nil,
List(),
List(1),
List(1,2),
List(1,2,3),
module ChatRoom where
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
-- MODEL
type alias Model =
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title>Validation Newsletter</title></head><body>
<table dir="ltr" style="background-color: rgb(249, 249, 249);" bgcolor="#f9f9f9" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="margin: 0pt; padding: 0pt;" align="left" valign="top">
<table style="border: 1px solid rgb(225, 227, 229); width: 600px;" align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody>
</tbody><tbody>
@letronje
letronje / clock_work.rb
Created June 4, 2013 13:34
clock_work.rb
require_relative 'config/boot'
require_relative 'config/environment'
module Clockwork
every(1.day, 'send_user_report', :at => '00:01', :tz => 'Asia/Kolkata'){
Rails.logger.debug 'triggering user report job @ one second past midnight'
CalculateUserReport.perform_async
}
end
@letronje
letronje / sidekiq_trace
Created June 3, 2013 10:55
sidekiq_trace.rb
2013-06-03T10:52:45Z 10349 TID-9tu GoogleDriveExporter JID-4517bb6835aa2f9360c1f2f8 INFO: start
2013-06-03T10:52:45Z 10349 TID-9tu GoogleDriveExporter JID-4517bb6835aa2f9360c1f2f8 INFO: fail: 0.007 sec
2013-06-03T10:52:45Z 10349 TID-9tu WARN: {"retry"=>true, "queue"=>"default", "class"=>"GoogleDriveExporter", "args"=>["Candidate", {"folder"=>{"url"=>""}, "rows_per_sheet"=>"10000", "email"=>"[email protected]", "columns"=>["email", "authentication_token"]}], "jid"=>"4517bb6835aa2f9360c1f2f8", "error_message"=>"undefined local variable or method `sdkfhksdhfjjkhsdfjkh' for #<GoogleDriveExporter:0x1645a9d @jid=\"4517bb6835aa2f9360c1f2f8\">", "error_class"=>"NameError", "failed_at"=>"2013-06-03T10:52:22Z", "retry_count"=>1, "retried_at"=>2013-06-03 10:52:45 UTC}
2013-06-03T10:52:45Z 10349 TID-9tu WARN: undefined local variable or method `sdkfhksdhfjjkhsdfjkh' for #<GoogleDriveExporter:0x1645a9d @jid="4517bb6835aa2f9360c1f2f8">
2013-06-03T10:52:45Z 10349 TID-9tu WARN: /media/workspace/src/api.jombay.com/app/
@letronje
letronje / her_err.rb
Created May 8, 2013 05:29
her_err.rb
TypeError: expected Array (got String) for param `y'
from /home/letronje/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/utils.rb:114:in `normalize_params'
from /home/letronje/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/utils.rb:121:in `normalize_params'
from /home/letronje/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/utils.rb:96:in `block in parse_nested_query'
from /home/letronje/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/utils.rb:93:in `each'
from /home/letronje/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/utils.rb:93:in `parse_nested_query'
from /media/workspace/src/frontend/config/initializers/her.rb:14:in `call'
module ActiveRecord
module ConnectionAdapters
class PostgreSQLAdapter
if defined?(Rails)
LOGGER_REGEXP = /^#{Rails.root}(?!\/vendor\/rails)/
def query_with_extra_logging(*args) #:nodoc:
if ActiveRecord::Base.enable_extended_logging && Rails.logger && Rails.logger.level == Logger::DEBUG
sql = args.first
unless (sql =~ /(pg_get_constraintdef|pg_attribute|pg_class)/)
<script>
FnordMetric.setup({
"address": "localhost:4242",
"namespace": "myapp"
});
</script>
@letronje
letronje / varnish.vcl
Created April 23, 2013 11:43
varnish.vcl
sub vcl_recv {
if (req.http.Authorization) {
return (pass);
}
return (lookup);
}
@letronje
letronje / varnish
Created April 19, 2013 10:49
varnish
Routes:
match '/test/:id' => 'dummy#test'
match '/user/:id' => 'dummy#user'
-------------------------------------
Controller:
def test