Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
// alphabet work derived from https://gist.github.com/remy/350433 | |
try { | |
// Test webstorage existence. | |
if (!window.localStorage || !window.sessionStorage) throw "exception"; | |
// Test webstorage accessibility - Needed for Safari private browsing. | |
localStorage.setItem('storage_test', 1); | |
localStorage.removeItem('storage_test'); | |
} catch(e) { | |
(function () { | |
var Storage = function (type) { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
# add something like this to config.ru | |
# see https://github.com/kzk/unicorn-worker-killer | |
if Integer(ENV['UNICORN_KILLER'] || 0) != 0 | |
require 'unicorn/worker_killer' | |
# Max memory size (RSS) per worker | |
use Unicorn::WorkerKiller::Oom, (350*(1024**2)), (400*(1024**2)), 30, true | |
end |
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
<script src="/etc/designs/cro/shared-resources/scripts/user-info.js"></script> | |
<script src="http://reactv-cq.herokuapp.com/css/bower_components/css-modal/modal.js"></script> | |
<!-- sitecatalyst setup --> | |
<script language="JavaScript">var s_account="cuconsumer,cuglobal" </script> | |
<script language="JavaScript" type="text/javascript" src="/etc/designs/cro/shared-resources/scripts/s_code.js"></script> | |
<!-- end sitecatalyst setup --> | |
<script> | |
function checkAuth() { |
ipfw add pipe 1 all from any to any && sudo ipfw pipe 1 config bw 1000Kbit/s delay 100ms |
{ val: 'US', label: 'UNITED STATES'}, | |
{ val: 'CA', label: 'CANADA'}, | |
{ val: 'AF', label: 'AFGHANISTAN'}, | |
{ val: 'AX', label: 'ALAND ISLANDS'}, | |
{ val: 'AL', label: 'ALBANIA'}, | |
{ val: 'DZ', label: 'ALGERIA'}, | |
{ val: 'AD', label: 'ANDORRA'}, | |
{ val: 'AO', label: 'ANGOLA'}, | |
{ val: 'AI', label: 'ANGUILLA'}, | |
{ val: 'AQ', label: 'ANTARCTICA'}, |
require 'benchmark' | |
require "bigdecimal" | |
require "bigdecimal/math" | |
include BigMath | |
@threads = [] | |
def asynch_pi(executions, digits) | |
# STDOUT.write "executions: #{executions}, digits: (#{digits})\n" | |
(1..executions).each do |number| |