[ Launch: interactive areas ] 5521603 by btucker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| =head1 NAME | |
| Rename Parameterized files (as downloaded by wget) | |
| =head1 DESCRIPTION | |
| This script will find any files with question marks in them, replace them with '--' and then | |
| do a multi-file find & replace for any references in all other files in the directory. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require File.expand_path('../../config/environment', __FILE__) | |
| how_many = 25000 | |
| my_class = Foo | |
| my_class.delete_all | |
| sc = my_class.create | |
| my_class.benchmark "#{how_many} finds" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Adds support for passing a :cache parameter to action definitions, eg: | |
| # | |
| # get '/state_map/?', :cache => 'state_map' do | |
| # ... | |
| # end | |
| # | |
| # :cache can also simply be passed true, in which case the route definition is used as the base | |
| # key name. In all cases, any params are also included in the key. | |
| # | |
| # Author: ben tucker <ben@btucker.net> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= form_tag action_path, :id => 'remote_form', :remote => true do %> | |
| <%= submit_tag %> | |
| <% end %> | |
| <div id="result"></div> | |
| <%= javascript_tag do %> | |
| jQuery(function($) { | |
| $("#remote_form").bind("ajax:success", function(ev, data) { | |
| $("#result").html(data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form action='http://example.com/shiva/lti/receive.php' encType='application/x-www-form-urlencoded'> | |
| <input name="oauth_consumer_key" type="hidden" value="key" /> | |
| <input name="oauth_signature_method" type="hidden" value="HMAC-SHA1" /> | |
| <input name="oauth_timestamp" type="hidden" value="1357860362" /> | |
| <input name="oauth_nonce" type="hidden" value="bwXOUxuuT2FV2VZ8EIbPqu7TwVetdgXigF30JmoPXrs" /> | |
| <input name="oauth_version" type="hidden" value="1.0" /> | |
| <input name="context_id" type="hidden" value="13" /> | |
| <input name="context_title" type="hidden" value=" Middle School Math (Master)" /> | |
| <input name="launch_presentation_return_url" type="hidden" value="http://uva-canlead.dev/modules/13" /> | |
| <input name="lis_person_contact_email_primary" type="hidden" value="ben@btucker.net" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table> | |
| <tr><td>Number</td><td>Price</td><tr> | |
| <tbody ng-repeat="order in orders"> | |
| <tr><td>{{order.description}}</td></tr> | |
| <tr> | |
| <td>{{order.number}}</td> | |
| <td>{{order.price}}</td> | |
| </tr> | |
| </tbody> | |
| </table> |
I hereby claim:
- I am btucker on github.
- I am btucker (https://keybase.io/btucker) on keybase.
- I have a public key whose fingerprint is FDE0 4E59 2DFA C6FC 37DC 08B2 D671 1E5F E0CE 45FB
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def self.human_attribute_name(col, options={}) | |
| col = case col.to_s | |
| when "address" | |
| "email address" | |
| else | |
| col | |
| end | |
| super(col, options) | |
| end |
I need a way to write WebSocket client code that runs on a server in Node.js.
What it must do: Exactly what this browser-based app does, only running on a server, without the UI stuff.
https://github.com/scripting/1999client/blob/master/code.js#L133
It would make so much sense if Node implemented exactly the browser API for WebSockets, native. So much of Node works that way. But this is one of those times when it doesn't.
There are a few toolkits that do WebSockets on the server. But there isn't simple clean sample code that I've been able to convert to this application. I tried! :-)
OlderNewer