layout | title | description | tags | ||
---|---|---|---|---|---|
default |
SQL Style Guide |
A guide to writing clean, clear, and consistent SQL. |
|
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
let Nightmare = require('nightmare'); | |
let harPlugin = require('nightmare-har-plugin'); | |
let options = { | |
waitTimeout: 1000 | |
}; | |
harPlugin.install(Nightmare); | |
let nightmare = Nightmare(Object.assign(harPlugin.getDevtoolsOptions(), options)); |
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
""" | |
Using "requests" to access Google Analytics Realtime Reporting API from python service | |
NOTE on google docs: The realtime reporting docs have samples for google-api-python-client. | |
**They do not work** at the time of this writing. The GA docs sample seems to refer to features that don't actually exist. | |
In any case, the new RR API is restfull and requests is a pleasent library so here is how to use it instead. | |
pip requirements: oauth2client, requests | |
""" |
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
# chromium | |
sudo apt install -y chromium-browser | |
# dev (php, docker, git, node, bower, electron, composer) | |
sudo apt install -y \ | |
php php-curl php-mysql \ | |
docker.io \ | |
git \ | |
nodejs npm | |
sudo ln -s /usr/bin/nodejs /usr/bin/node |
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
/* | |
General format: | |
curl -X POST --data-urlencode 'payload={"channel": "#sense-notification", "username": "webhookbot", "text": "This is posted to #sense-notification and comes from a bot named sensebot.", "icon_emoji": ":ghost:"}' https://hooks.slack.com/services/<....enter_your_key_here....> | |
Formatting: https://slack.zendesk.com/hc/en-us/articles/202288908-How-can-I-add-formatting-to-my-messages- | |
More formatting formatting: https://api.slack.com/docs/formatting | |
Slack API docs: https://api.slack.com/incoming-webhooks | |
Available emojis: http://www.emoji-cheat-sheet.com/ | |
*/ |
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
#' Suppress all output from an expression. Works cross-platform. | |
#' @param expr Expression to run. | |
#' @param all If \code{TRUE} then suppress warnings and messages as well; | |
#' otherwise, only suppress printed output (such as from \code{print} or | |
#' \code{cat}). | |
#' @keywords internal | |
#' @export | |
quiet <- function(expr, all = TRUE) { | |
if (Sys.info()['sysname'] == "Windows") { | |
file <- "NUL" |
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
<? | |
///////////////////// | |
// slack2html | |
// by @levelsio | |
///////////////////// | |
// | |
///////////////////// | |
// WHAT DOES THIS DO? | |
///////////////////// | |
// |
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
# Plots a graph of retention after exporting data from Mixpanel's retention | |
# feature. See Thoughtbot blog: https://robots.thoughtbot.com/create-a-retention-curve-with-mixpanel-and-google-sheets | |
# and my blog: http://www.brycemcdonnell.com/plotting-user-retention-curves-in-R/ | |
library(lubridate) | |
library(tidyr) | |
library(dplyr) | |
library(ggplot2) | |
## |
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
#!/bin/bash | |
# | |
# Installs the latest RStudio daily desktop build for OSX/macOS and Ubuntu(amd64) | |
# | |
# https://support.rstudio.com/hc/en-us/articles/203842428-Getting-the-newest-RStudio-builds | |
set -e | |
install_macos_daily() { | |
REDIRECT_URL="https://www.rstudio.org/download/latest/daily/desktop/mac/RStudio-latest.dmg" |
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
require(RMySQL) | |
require(ggplot2) | |
require(scales) | |
myusername = "peter" | |
mypassword = "sekret" | |
system('ssh -f pe@192.168.0.10 -L 3306:localhost:3306 -N -o ExitOnForwardFailure=yes') | |
con <- dbConnect(MySQL(), | |
user=myusername, password=mypassword, |