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
private static void rangeCheck(int arrayLen, int fromIndex, int toIndex { | |
if (fromIndex > toIndex) | |
throw new IllegalArgumentException("fromIndex(" + fromIndex + | |
") > toIndex(" + toIndex+")"); | |
if (fromIndex < 0) | |
throw new ArrayIndexOutOfBoundsException(fromIndex); | |
if (toIndex > arrayLen) | |
throw new ArrayIndexOutOfBoundsException(toIndex); | |
} |
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
// Bind F7 to 'step' | |
javascript:$(document).bind('keydown', function(e) { e.which == 118 && parse('s'); }); void(0) | |
// Add a 'readhex' command that works just like 'read' but dumps nothing but the hex | |
javascript:cpu._readhex = | |
function(e) { | |
if (!e[1]) return write(" Please give an expression to read the memory at."), void 0; | |
var t = cpu.to_addr(e[1]); | |
cpu.get("/cpu/dbg/memory/" + t + "?len=" + (parseInt(e[2], 16) + (15 - parseInt(e[2], 16) & 15) || 32), function(e) { | |
for (var n = atob(e.raw), i = "", o = " ", s = 0; s < n.length; s++) s % 2 == 0 && (o += " "), o += pad(n.charCodeAt(s).toString(16), 2), s % 8 == 7 && (i += " " + o + "\n", o = " "); |
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
# -*- coding: utf-8 -*- | |
import httplib2 | |
import re | |
cadpat = re.compile('Daily.*?<td> ([0-9.]+) \(CAD\)', re.DOTALL) | |
usdpat = re.compile('"btc_to_usd":"([0-9.]+?)"') | |
dogepat = re.compile('"lasttradeprice":"([0-9.]+?)"') | |
def get_html(url): | |
_, html = httplib2.Http(disable_ssl_certificate_validation=True).request(url) |
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
import httplib2 | |
import re | |
cadpat = re.compile('Daily.*?<td> ([0-9.]+) \(CAD\)', re.DOTALL) | |
dogepat = re.compile('DOGE/BTC<div.*?>\(last: ([0-9.]+)\)</') | |
def get_html(url): | |
_, html = httplib2.Http(disable_ssl_certificate_validation=True).request(url) | |
return html |
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
first create a new Zone called World and add any country to it | |
then fire up your ruby console and do: | |
Spree::Country.find_each { |country| Spree::ZoneMember.create! zone_id: Spree::Zone.where(:name => "World").first.id, zoneable_id: country.id, zoneable_type: "Spree::Country" } |
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
Bundler could not find compatible versions for gem "jquery-rails": | |
In Gemfile: | |
spree (>= 0) ruby depends on | |
jquery-rails (~> 2.1.4) ruby | |
jquery-rails (2.2.0) |
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
aorr@l00055-ubu:~/whatme/store2/db/migrate$ ls | |
20130118015901_spree_one_two.spree.rb | |
20130118015902_add_tax_rate_label.spree.rb | |
20130118015903_add_toggle_tax_rate_display.spree.rb | |
20130118015904_remove_unused_preference_columns.spree.rb | |
20130118015905_add_lock_version_to_variant.spree.rb | |
20130118015906_add_states_required_to_countries.spree.rb | |
20130118015907_add_on_demand_to_product_and_variant.spree.rb | |
20130118015908_remove_not_null_constraint_from_products_on_hand.spree.rb | |
20130118015909_split_prices_from_variants.spree.rb |
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
gem 'spree_gateway', :github => 'spree/spree_gateway', :branch => '1-3-stable' | |
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-3-stable' |
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
class Array | |
def with(range) | |
range.each do |i| | |
self.push i if not self.include? i | |
end | |
self | |
end | |
def then(range) | |
self.with(range) |
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
#include "inc/hw_memmap.h" | |
#include "inc/hw_types.h" | |
#include "driverlib/adc.h" | |
void main(void) { | |
unsigned long ulValue; | |
// | |
// Enable the first sample sequencer to capture the value of channel 0 when | |
// the processor trigger occurs. | |
// |