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
# Installing google chrome via APT (sadly no SNAP available from Google, like there is for Chromium) | |
# Setup the Google signer and repo | |
curl -O https://packages.cloud.google.com/apt/doc/apt-key.gpg && sudo apt-key add apt-key.gpg | |
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' | |
# Install | |
sudo apt-get update | |
sudo apt-get install google-chrome-stable |
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
const fs = require('fs'); | |
const parse = require('parse-diff'); | |
const axios = require('axios'); | |
// Load pull request diff from GitHub REST API | |
const requestConfig = { | |
headers: { | |
'Accept': 'application/vnd.github.diff' | |
} | |
}; |
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
FROM nginx | |
# Copy custom error pages | |
COPY html /usr/share/nginx/html | |
# nginx defaults like logging | |
COPY nginx/default.conf /etc/nginx/conf.d/default.conf | |
# nginx mapping file for URL routing | |
COPY nginx/nginx.conf /etc/nginx/nginx.conf |
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
FROM gcloud-bash | |
# Common utils also used with gcloud/bash | |
RUN apt-get update -qqy \ | |
&& apt-get -qqy install python3-virtualenv python3-pip\ | |
&& apt-get -qyy autoremove \ | |
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* | |
RUN pip3 install flask flask-api |
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 | |
# Requires `watch` and `jq` | |
watch -d -n 1 -c -t \ | |
"curl -s 'http://fig.gogoinflight.com/v1/flights?registration-number=N190UW&status=current&detail=true' | jq -C '.[].flight.gps'" |
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
# Add the following to /usr/share/applications/idea.desktop | |
# You can now search in launcher (e.g ALT+SPACE for IDEA or Intellij and launch) | |
# Note: I install IDEA releases in /opt/idea/ and symlink to the current version with head/, hence /opt/idea/head/ | |
[Desktop Entry] | |
Version=2017.2 | |
Name=Intellij Ultimate Edition | |
Comment=The Drive to Develop | |
GenericName=Intellij IDEA | |
# Update with your local install location |
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 | |
set -e | |
FULL_SPEC_PATH="/path/to/spec.json" # Absolute, please | |
# Idempotent, local library install | |
virtualenv . | |
source bin/activate | |
pip install swagger-spec-validator | |
# Test the Spec |
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
/** | |
Simple benchmark of different ways to do modulo | |
- Numbers collected on a 4Ghz i7-4790K, 8 core AMD, 32GB PC3 19200 ram, SSD | |
- Scala 2.11.8 | |
- Java 1.8.0_91 | |
# scalac mod_perf.scala && scala ModPerf | |
**/ | |
object ModPerf extends App { | |
final val N = 1000000 |
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 | |
/** | |
* @author Lustforge.com, 2010 | |
* @version requires PHP 4.3 or higher | |
* @abstract Easily grab the Wordpress Hashcash hash for a given blog. Returns FALSE on failure. | |
* @example $HTML = file_get_contents('http://wordpress-plugins.feifei.us/hashcash/'); | |
* $hash = UnHashCash::getHash($HTML); | |
* echo $hash; | |
*/ |