Skip to content

Instantly share code, notes, and snippets.

var html = new HtmlDocument();
// load the document's html
html.LoadHtml(document.Html);
// create a string of the text only
document.Text = Regex.Replace(string.Join(" ", html.DocumentNode.SelectNodes("//text()").Select(m => m.InnerText)), @"\s+", " ").Trim();
@ryancole
ryancole / app.coffee
Created January 28, 2011 17:49
new, simple nodejs web server in coffeescript
http = require 'http'
server = http.createServer (req, res) ->
res.writeHead 200, {'Content-Type': 'application/json'}
res.end(JSON.stringify [1,2,3])
server.listen 8000
.button {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 1px 2px 1px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 1px 2px 1px rgba(0, 0, 0, 0.1);
box-shadow: 1px 2px 1px rgba(0, 0, 0, 0.1);
display: inline-block;
margin: 0;
overflow: hidden;
@ryancole
ryancole / superdj.js
Created June 21, 2011 03:56
become a super dj on turntable.fm
function spam_dj_button() { $('.become_dj').click(); console.log('clicked button.'); }
var foo = setInterval('spam_dj_button()', 100);
private void AddMediaSource(Int32 p_evidenceId)
{
foreach (BaseLabeledEdit field in flowLayoutPanel1.Controls)
{
if (field.Visible)
{
MessageBox.Show(field.GetType().FullName);
}
}
}
express = require 'express'
routes = require './routes'
models = require './models'
# initialize the application server
app = module.exports = express.createServer()
...
bcrypt = require 'bcrypt'
# define the user db object
class Account
constructor: (@db) ->
@account = @db.collection 'accounts'
exports.signin_p = (req, res) ->
spec =
username: req.body.account.username
password: req.body.account.password
models.account.authenticate spec, (err, account) ->
if not account
res.redirect 'back'
require.config({
paths: {
use: '/public/js/lib/use',
json2: 'http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2',
jquery: 'http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min',
backbone: 'http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min',
underscore: 'http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.1/underscore-min'
},
GET http://b.scorecardresearch.com/crossdomain.xml b.scorecardresearch.com/crossdomain.xml:1
GET http://stats.jtvnw.net/672253?preroll_skipped&host=raidbossanalytics.com&channel=tsm_dyrus&category=gaming&flash_lang=en-us&subcategory=null&language=null&subscription_program=true&meta_game=League%20of%20Legends&consumer_key=NAiWRBGmYxJyx1jkgPWiTw&viewer_geo=us&is_subscriber=false&is_private=false&is_pro_user=false&pageUrl=http%3A%2F%2Fraidbossanalytics.com%2Fryan&player_type=api&publisher_geo=US&ip=65.36.59.196&reason=preroll_delay&page_type=null&program=producer stats.jtvnw.net/672253?preroll_skipped&host=raidbossanalytics.com&channel=tsm_dyrus&category=gaming&flash_lang=en-us&subcategory=null&language=null&subscription_program=true&meta_game=League%20of%20Legends&consumer_key=NAiWRBGmYxJyx1jkgPWiTw&viewer_geo=us&is_subscriber=false&is_private=false&is_pro_user=false&pageUrl=http%3A%2F%2Fraidbossanalytics.com%2Fryan&player_type=api&publisher_geo=US&ip=65.36.59.196&reason=preroll_delay&page_type=null&program=p