$ uname -r
This file contains hidden or 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
// This gist is based on @wnstn's great [gist](https://gist.github.com/wnstn/36010c8378e850cc3580) | |
// and @maykefreitas's [advice](https://github.com/BrowserSync/browser-sync/issues/977#issuecomment-236443965) about turbolinks. | |
// Code below is generated after running `browser-sync init` in your project's root directory. | |
// I commented the lines I changed or added so you can run it from scratch as well, if you like. | |
/* | |
|-------------------------------------------------------------------------- | |
| Browser-sync config file |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
"""A simple tool to document how to control AWS resources. | |
AWS AUTHENTICATION | |
------------------- | |
In order to run any of the code below, you need a profile with AWS credentials | |
set up on your computer. It's very easy to do this. Google how to configure | |
your profile with boto3, or visit the docs: |
This file contains hidden or 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
#/usr/bin/env bash | |
rm -rf ./.pngs | |
rm -rf ./.gifs | |
mkdir .pngs | |
mkdir .gifs | |
ffmpeg -i $1 -r 10 ./.pngs/out%04d.png | |
sips -s format gif ./.pngs/*.png --out ./.gifs | |
gifsicle ./.gifs/*.gif --optimize=3 --delay=3 --loopcount --resize 720x405 --colors=255 > $1.gif | |
gifsicle --unoptimize $1.gif | gifsicle --dither --colors 48 --resize-fit-width 512 -O2 `seq -f "#%g" 0 2 213` -o $1.optimized.gif | |
rm -rf $1.gif |
This file contains hidden or 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
# usage: | |
# it "should return a result of 5" do | |
# eventually { long_running_thing.result.should eq(5) } | |
# end | |
module AsyncHelper | |
def eventually(options = {}) | |
timeout = options[:timeout] || 2 | |
interval = options[:interval] || 0.1 | |
time_limit = Time.now + timeout |
Uploads large files in multiple chunks. Also has the ability to resume if the upload is interrupted.
Typical usage:
- Send a POST request to
/upload
with the first chunk of the file and receive an upload id in return. - Repeatedly PATCH subsequent chunks using the upload id to identify the upload in progress and an offset representing the number of bytes transferred so far.
- After each chunk has been uploaded, the server returns a new offset representing the total amount transferred.
- After the last chunk commit the upload by passing its id to another endpoint such as
POST /upload/commit/:id
:
###rpush - https://github.com/rpush/rpush
Follow the steps in rpush to add the gem to your rails project
####PushNotificationDevice
rails g model PushNotificationDevice device_type:integer:index device_token:string
class CreatePushNotificationDevices < ActiveRecord::Migration
This file contains hidden or 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
########################################## | |
# To run: | |
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x | |
########################################## | |
# Check that HTTPS transport is available to APT | |
if [ ! -e /usr/lib/apt/methods/https ]; then | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https | |
fi |