Skip to content

Instantly share code, notes, and snippets.

@xorrbit
xorrbit / gist:8848780
Last active June 18, 2016 12:20
Instructions for compiling maxcoin-cpuminer on Windows
Instructions for compiling maxcoin-cpuminer on Windows:
1. Tip me some BTC at 18Hrj6cmmCzCGzv7wVmKFxjYvUSwugvi41 or Doge at
DUCYmX3EYJc4JiHfdVN6pPGM98S6CtoyVm :)
2. Download and install Cygwin 64 bit setup from http://www.cygwin.com/. Here
is a direct link to the latest version: http://cygwin.com/setup-x86_64.exe
3. Run the setup as administrator. Use defaults until you get to the package
selection screen. Find these packages one by one and click next to them where
// 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 = " ");
@xorrbit
xorrbit / doge.py
Created December 20, 2013 19:14
doge.py
# -*- 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)
@xorrbit
xorrbit / caddoge.py
Last active December 31, 2015 06:39
Scrapes doge/btd and cad/doge and tells you cad per 100k doge.
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
@xorrbit
xorrbit / gist:5497013
Created May 1, 2013 18:04
Creating a world zone in spree
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" }
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)
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
gem 'spree_gateway', :github => 'spree/spree_gateway', :branch => '1-3-stable'
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-3-stable'
@xorrbit
xorrbit / array_with_then.rb
Created December 18, 2012 18:00
Array range set thing
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)
@xorrbit
xorrbit / gist:4083851
Created November 16, 2012 03:46
FOR THE DOCTOR
#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.
//