A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord
// See tth.im/s3json for a full explanation of this code | |
const AWS = require('aws-sdk'); | |
const S3 = new AWS.S3(); | |
exports.handler = async (_, context) => { | |
try { | |
const query = 'SELECT * FROM s3object[*].results[*] r;'; | |
// test query is against data from https://swapi.co/api/planets/?page=2 |
NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
cat test.json | jq -c '.[]' > testNDJSON.json
aws s3api list-buckets
--query 'Buckets[*].Name'
#!/usr/bin/env ruby | |
# | |
# Prerequisites: | |
# gem install bundler | |
# bundle install | |
dependencies = `bundle show | grep '*' | awk '{print $2, $3}' | sed -e 's/(//' -e 's/)//'`.split("\n") | |
dependencies.each do |dependency| | |
(gem_name, version) = dependency.split |
/** | |
* @author knee-cola / https://github.com/knee-cola | |
* Original file URL: https://gist.github.com/knee-cola/37875bc4359609b96c9f329cd2a68fa1 | |
*/ | |
// This is a simple progressive image loader for Three.js | |
// It enables the smaller image files to be loaded first, | |
// before the big texture image is fully loaded. | |
// | |
// The images are loaded in the order they are passed |
Adaptive Streaming has become the neccessity for streaming video and audio. Unfortantely, as of this post, there isn't a whole lot of tutorials that accumulate all of the steps to get this working. Hopefully this post achieves that. This post focuses on using Amazon Web Services (AWS) to transcode for HLS and DASH and be the Content Delivery Network (CDN) that delivers the stream to your web page. We'll be using Video.js for the HTML5 player as well as javascript support libaries to make Video.js work with HLS and DASH.
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
brew tap homebrew/versions | |
brew install v8-315 | |
gem install libv8 -v '3.16.14.13' -- --with-system-v8 | |
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315 | |
bundle install |
# Install QEMU OSX port with ARM support | |
sudo port install qemu +target_arm | |
export QEMU=$(which qemu-system-arm) | |
# Dowload kernel and export location | |
curl -OL \ | |
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie | |
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie | |
# Download filesystem and export location |