Skip to content

Instantly share code, notes, and snippets.

from bs4 import BeautifulSoup, SoupStrainer
import httplib2
import random
print random.choice([link.getText().replace("//","").strip().encode('utf-8') for link in BeautifulSoup(httplib2.Http().request('http://www.velominati.com/the-rules/')[1]).findAll("div", { "class" : "rule" })])
<!DOCTYPE html>
<html>
<head>
<title>tableToExcel Demo</title>
<script src="tableToExcel.js"></script>
</head>
<body>
<h1>tableToExcel Demo</h1>
<p>Exporting the W3C Example Table</p>
--Bundleconfig.cs
bundles.Add(new StyleBundle("~/Content/Contacts").Include("~/Content/Contacts.css")
--Contacts.cshtml
@section head {
@Styles.Render("~/Content/Contacts")
}
# Raw transaction API example work-through
# Send coins to a 2-of-3 multisig, then spend them.
#
# For this example, I'm using these three keypairs (public/private)
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw
# First: combine the three keys into a multisig address:
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9
USE MASTER
DECLARE @MemoryDenominator INT
SET @MemoryDenominator = 1048576
select
cpu_count [CPUs]
,hyperthread_ratio [Hyperthread Ratio]
,physical_memory_in_bytes / @MemoryDenominator as [Memory (MB)]
,virtual_memory_in_bytes / @MemoryDenominator as [Virtual Memory (MB)]
@beachandbytes
beachandbytes / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
//The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.
//Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product?
var digits = 13;
var numStr = "73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
@beachandbytes
beachandbytes / keygen.py
Last active August 29, 2015 14:25 — forked from gythialy/keygen.py
#!/usr/bin/env python
"""
THIS SCRIPT IS USED FOR EDUCATIONAL PURPOSES ONLY. DO NOT USE IT IN ILLEGAL WAY!!!
"""
import base64
from datetime import datetime
from hashlib import sha1
import zlib
var variablebuttonname = 'woo woo';
var dialog_buttons = {}
dialog_buttons[variablebuttonname] = function(){
$(this).dialog('close'); //Or whatever you want the button to do
}
$('#cSearch').simpledialog2({
mode: 'button',
zindex: 10000,
headerText: 'Select Phone Number',
headerClose: false,
SELECT
P.club
,memberCount.members
,SUM(O.Price * P.qnty) [sales]
FROM purchase P
INNER JOIN offer O ON O.club = P.club AND P.title = O.title
INNER JOIN (
SELECT M.club,COUNT(*) [members]
FROM members M
GROUP BY M.club