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
| // jQuery checkbox utility plugin. | |
| // Triggers "change" events on the checkboxes. | |
| // By Henrik Nyh <http://henrik.nyh.se> 2009-04-27 under the MIT License. | |
| (function($) { | |
| function makeChecked($checkboxes, checked) { | |
| return $checkboxes.prop("checked", checked).trigger("change"); | |
| } |
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
| for (var i=0; i < 100000; i++) { | |
| db.mass_insert.save({ | |
| "first_name": "James", | |
| "middle_name": "Richard", | |
| "last_name": "Windsgate", | |
| "email": "[email protected]" | |
| }); | |
| }; |
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
| NOTE: I am using bash for this. | |
| NOTE2: Another approach for getting tmux would be to use gentoo-prefix or netbsd's pkgsrc. I | |
| didn't have too much luck with gentoo-prefix. NetBSD was pretty straight forward but it had | |
| an old version of tmux (1.1). | |
| Here is how to get tmux compiled if you can get your systadmins to installed it ... or | |
| any other weird reason. I assume you have some basic libraries and headers installed (like | |
| ncurses, etc...). If not, you'll have to compile those ones too. |
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 numpy as np | |
| from scipy.stats import chisqprob, chisquare | |
| def gtest(f_obs, f_exp=None, ddof=0): | |
| """ | |
| http://en.wikipedia.org/wiki/G-test | |
| The G test can test for goodness of fit to a distribution | |
| Parameters |
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
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
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
| #!/bin/bash | |
| function flask-boilerplate-tmux | |
| { | |
| # https://github.com/swaroopch/flask-boilerplate | |
| BASE="$HOME/code/flask-boilerplate" | |
| cd $BASE | |
| tmux start-server | |
| tmux new-session -d -s flaskboilerplate -n model |
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
| # | |
| # Copyright (C) 2010-2012 Vinay Sajip. All rights reserved. Licensed under the new BSD license. | |
| # | |
| import ctypes | |
| import logging | |
| import os | |
| class ColorizingStreamHandler(logging.StreamHandler): | |
| # color names to indices | |
| color_map = { |
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
| """SocksiPy - Python SOCKS module. | |
| Version 1.00 | |
| Copyright 2006 Dan-Haim. All rights reserved. | |
| Redistribution and use in source and binary forms, with or without modification, | |
| are permitted provided that the following conditions are met: | |
| 1. Redistributions of source code must retain the above copyright notice, this | |
| list of conditions and the following disclaimer. | |
| 2. Redistributions in binary form must reproduce the above copyright notice, |
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 User(db.Model): | |
| location = db.StringProperty() | |
| timezone = db.StringProperty(default='America/Los_Angeles') | |
| # Do this once per user | |
| def calculate_timezone(self): | |
| from simplegeo import Client | |
| client = Client('oauth key', 'oauth secret SHH') | |
| response = client.context.get_context_by_address(self.location) | |
| for feature in response['features']: |
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
| #!/bin/sh | |
| # Just copy and paste the lines below (all at once, it won't work line by line!) | |
| # MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
| function abort { | |
| echo "$1" | |
| exit 1 | |
| } | |
| set -e |
OlderNewer