npm install forever -g
forever --help
forever start app.js
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB | |
#/32 = 496630545 = 473MB | |
#/64 = 248315272 = 236MB | |
#/128 = 124157636 = 118MB | |
#/256 = 62078818 = 59MB | |
#/512 = 31039409 = 29MB | |
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762 | |
#/25165760 = 623 # half of max_connections = 1993.6MB | |
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608 | |
#*(3/4) #default innodb pool size = 11922309120 |
var R = require("request"); | |
var key = process.env.TWITTER_CONSUMER_KEY; | |
var secret = process.env.TWITTER_CONSUMER_SECRET; | |
var cat = key +":"+secret; | |
var credentials = new Buffer(cat).toString('base64'); | |
var url = 'https://api.twitter.com/oauth2/token'; | |
R({ url: url, |
from __future__ import division | |
import collections | |
import numpy as np | |
import matplotlib | |
import matplotlib.pyplot as plt | |
from scipy.spatial import Delaunay, KDTree | |
# an adaptation of https://stackoverflow.com/a/15783581/60982 | |
# using ideas from https://stackoverflow.com/a/9471601/60982 |
These instructions will guide you through the process of setting up local, trusted websites on your own computer.
These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.
NOTE: You may substitute the edit
command for nano
, vim
, or whatever the editor of your choice is. Personally, I forward the edit
command to Sublime Text:
alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |
// Bookmarklet for Pinboard | |
// Show tweets in popular page | |
// Copied from https://www.onfocus.com/2016/11/6842/pinboard-popular-tweets | |
javascript:(function(){var%20s=document.createElement("script");s.type="text/javascript";s.src="https://platform.twitter.com/widgets.js";s.async=true;document.head.append(s);setTimeout(function(){var%20bookmarks=document.getElementsByClassName("bookmark_title");var%20tweets=new%20Array();for(var%20i=0;i<bookmarks.length;i++){var%20burl=bookmarks[i].getAttribute("href");var%20re=new%20RegExp("status\/(\\d{15,20})");var%20e=re.exec(burl);if(e!==null){bookmarks[i].innerHTML+='<div%20id="t'+e[1]+'"%20tweetID="'+e[1]+'"%20style="width:500px;"></div>';var%20id=e[1];var%20tweet=document.getElementById('t'+id);if(!tweets.includes(e[1])){twttr.widgets.createTweet(id,tweet,{conversation:'none',cards:'visible',linkColor:'#cc0000',theme:'light'});}tweets.push(e[1]);}}},500);})(); |
cat <<EOF >> /etc/apt/sources.list | |
deb http://archive.ubuntu.com/ubuntu precise main restricted universe | |
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe | |
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse | |
EOF | |
apt-get update | |
apt-get purge \ | |
apache2 \ |
import csv, os, re | |
# https://www.ssa.gov/oact/babynames/state/namesbystate.zip | |
path_to_names = '.' | |
names = [] | |
index = {} | |
# Iterate over each state file (e.g., CA.TXT). | |
for filename in os.listdir(path_to_names): |
SELECT | |
user_pseudo_id, | |
TIMESTAMP_MICROS(event_timestamp) AS session_start_ts, | |
CAST(LEAD(TIMESTAMP_MICROS(event_timestamp),1) OVER (PARTITION BY CONCAT(user_pseudo_id) | |
ORDER BY | |
event_timestamp) AS timestamp) AS session_end_ts, | |
(SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id') AS session_id, | |
(SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_number') AS session_number, | |
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_referrer') AS referrer, | |
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_location') AS landing_page_path, |