Skip to content

Instantly share code, notes, and snippets.

@austinfromboston
austinfromboston / main.py
Last active November 21, 2020 17:13
validator check client
import base64
import requests
import os
from twilio.rest import Client
CHAIN_API="https://medalla.beaconcha.in"
COUNTRY_CODE="+1"
FAILURE_THRESHOLD=100
def check_validator(event, context):
@austinfromboston
austinfromboston / row_counter.rb
Last active August 29, 2015 14:17
this is a simple way to count the rows in your database, in case you are trying to track down where rows are getting created
class RowCounter
def self.checkpoint
@counter_collection ||= []
@counter_collection << RowCounter.new
@counter_collection[-1] - @counter_collection[-2]
end
def initialize
census
/Users/austin/.rvm/gems/ruby-2.0.0-p195@myapp/gems/capistrano-2.15.4/lib/capistrano/configuration/variables.rb:82:in `block in fetch': `rvm_ruby_string_evaluated' not found (IndexError)
from /Users/austin/.rvm/gems/ruby-2.0.0-p195@myapp/gems/capistrano-2.15.4/lib/capistrano/configuration/variables.rb:110:in `block in protect'
from /Users/austin/.rvm/gems/ruby-2.0.0-p195@myapp/gems/capistrano-2.15.4/lib/capistrano/configuration/variables.rb:110:in `synchronize'
from /Users/austin/.rvm/gems/ruby-2.0.0-p195@myapp/gems/capistrano-2.15.4/lib/capistrano/configuration/variables.rb:110:in `protect'
from /Users/austin/.rvm/gems/ruby-2.0.0-p195@myapp/gems/capistrano-2.15.4/lib/capistrano/configuration/variables.rb:78:in `fetch'
from /Users/austin/.rvm/gems/ruby-2.0.0-p195@myapp/gems/capistrano-2.15.4/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /Users/austin/.rvm/gems/ruby-2.0.0-p195@myapp/gems/rvm-capistrano-1.4.0.rc2/lib/rvm/capistrano/install_ruby.rb:35:in `block (3 levels) in <top
i ran into a weird issue with block comments and indentation. Following code blows up on compile:
publish: ->
"foo"
###
Any random text
###
Server: {}
irb> ObjectSpace.each_object { |o| puts o if o.respond_to?(:ancestors) and o.ancestors.include?(Enumerable) }
Enumerable::Enumerator
Struct::Tms
Dir
File
IO
Range
Struct
Hash
# from lib / import_from_marshal.rb
def self.load
data = Marshal.load(`bzcat #{Rails.root}/private/rockwood_legacy.marshal.bz2`)
t = LegacyTraining.new
t.add_questions
@@txt_questions = t.text_questions
@@num_questions = t.numeric_questions
@@answers = 0
# numeric_questions = t.numeric_questions.sort(&:order)
# text_questions = t.text_questions.sort(&:order)
/**
* windowName transport plugin for jQuery
*
* Thanks to Kris Zyp <http://www.sitepen.com/blog/2008/07/22/windowname-transport/>
* for the original idea and some code
*
* Licensed under GPLv3: http://www.gnu.org/licenses/gpl-3.0.txt
* @author Marko Mrdjenovic <jquery@friedcellcollective.net>
*
* @author Austin Putman <austin hat radicaldesigns dhot org>
/**
* windowName transport plugin for jQuery
*
* Thanks to Kris Zyp <http://www.sitepen.com/blog/2008/07/22/windowname-transport/>
* for the original idea and some code
*
* Licensed under GPLv3: http://www.gnu.org/licenses/gpl-3.0.txt
* @author Marko Mrdjenovic <jquery@friedcellcollective.net>
*
* @author Austin Putman <austin hat radicaldesigns dhot org>
---
public/javascripts/jquery/jquery-1.2.6.js | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/public/javascripts/jquery/jquery-1.2.6.js b/public/javascripts/jquery/jquery-1.2.6.js
index 88e661e..5db150d 100644
--- a/public/javascripts/jquery/jquery-1.2.6.js
+++ b/public/javascripts/jquery/jquery-1.2.6.js
@@ -2566,6 +2566,9 @@ jQuery.extend({
data: null,
s.data = s.data + '&' + $('form.link_form').serialize();
<% form_for :all_links, :url => '/some/route', :html => { :class => 'hidden link_form' } do |f| %>
&nbsp;
<% end %>