Skip to content

Instantly share code, notes, and snippets.

View IronistM's full-sized avatar
🏗️
Under construction

Manos Parzakonis IronistM

🏗️
Under construction
View GitHub Profile
@justinph
justinph / nightmare.js
Last active March 29, 2018 17:57
Webpage performance testing with nightmare.js
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));
@ivanvenosdel
ivanvenosdel / ga_realtime_reporting_service.py
Last active January 20, 2021 04:01
Python "requests", Google Analytics Realtime Reporting API (for oauth2 service accounts)
"""
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
"""
@floriancourgey
floriancourgey / setup-elementary.sh
Last active September 5, 2018 05:51
Things to do after installing elementary OS Loki 0.4
# 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
@fredbenenson
fredbenenson / kickstarter_sql_style_guide.md
Last active April 2, 2024 15:19
Kickstarter SQL Style Guide
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

/*
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/
*/
@daattali
daattali / quiet.R
Created September 25, 2015 00:35
Suppress all output from an expression, cross-platform
#' 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"
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@brycemcd
brycemcd / user_retention_curve.R
Last active September 21, 2016 12:13
Automatically take a waterfall graph in Mixpanel and create a user retention curve
# 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)
##
@aronatkins
aronatkins / install-rstudio-daily.sh
Last active February 10, 2022 08:54
Install RStudio daily build on OSX/macOS or Ubuntu Linux
#!/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"
@pengelbrecht
pengelbrecht / cohort_analysis.R
Created September 30, 2014 15:58
R Cohort Analysis Example
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,