This file contains 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
javascript:(function(){var%20s=document.createElement('script'),l=location.href;s.type='text/javascript';s.src='http://bit.ly/javascript-api.js?version=latest&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07';s.onload=function(){BitlyCB.f=function(d){location.href='http://twitter.com/home?status='+encodeURIComponent(document.title+'%20'+d.results[l]['shortUrl'])};BitlyClient.shorten(l,'BitlyCB.f')};document.body.appendChild(s)})() |
This file contains 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
<?php | |
/** | |
* An example of how to use the `squarize()` function below. | |
*/ | |
$path_input = 'input.png'; | |
$path_output = 'output.png'; | |
$thumb_w = 100; | |
$thumb_h = 100; |
This file contains 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
<?php | |
/** | |
* Wrapper class for AtomicParsley for setting iTunes style meta data on MPEG-4 files. | |
* | |
* Dependencies: | |
* - Bunsen <http://github.com/jnrbsn/bunsen> | |
* - AtomicParsley <http://atomicparsley.sourceforge.net/> | |
*/ | |
class AtomicParsley |
This file contains 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
<?php | |
error_reporting(-1); | |
set_time_limit(0); | |
$host = '0.0.0.0'; | |
$port = 12345; | |
$max_clients = 10; | |
// Create the socket. |
This file contains 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
<?php | |
/** | |
* Objected-oriented command line output library for PHP. | |
* | |
* Dependencies: | |
* - Console_Color PEAR package | |
* - Bash | |
* | |
* PHP version 5 | |
* |
This file contains 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
try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } |
This file contains 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
sudo yum update | |
sudo yum install python27 | |
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | sudo /usr/bin/python27 | |
sudo easy_install pip | |
echo "alias python='python27'" >> ~/.bashrc | |
source ~/.bashrc |
This file contains 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
function j(u, c) { | |
var h = document.getElementsByTagName('head')[0], s = document.createElement('script'); | |
s.async = true; s.src = u; | |
s.onload = s.onreadystatechange = function () { | |
if (!s.readyState || /loaded|complete/.test(s.readyState)) { | |
s.onload = s.onreadystatechange = null; if (h && s.parentNode) { h.removeChild(s) } s = undefined; | |
if (c) { c() } | |
} | |
}; | |
h.insertBefore(s, h.firstChild); |
This file contains 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 inspect | |
def privatemethod(func): | |
"""decorator for making an instance method private""" | |
def func_wrapper(*args, **kwargs): | |
"""decorator wrapper function""" | |
outer_frame = inspect.stack()[1][0] | |
if 'self' not in outer_frame.f_locals or outer_frame.f_locals['self'] is not args[0]: | |
raise Exception('%s.%s is a private method' % (args[0].__class__.__name__, func.__name__)) | |
func(*args, **kwargs) |
This file contains 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
# Fatality rate of coronavirus outside China [1] | |
corona_fatal_rate = (3168 - 2945) / (92880 - 80152) | |
# Cases in USA [1] | |
corona_cases_usa = 118 | |
# Population of USA [2] | |
population_usa = 329346645 | |
# "Infection rate" of coronavirus in USA | |
corona_infect_rate = corona_cases_usa / population_usa | |
# Fatality rate of flu in USA [3] | |
# (average of 5 most recent seasons for which there's data 2012-2017) |