Skip to content

Instantly share code, notes, and snippets.

View rilian's full-sized avatar

rilian rilian

View GitHub Profile
@rilian
rilian / README.md
Created March 10, 2024 21:21 — forked from abelcallejo/README.md
Create bootable Linux USB using Mac

Creating bootable Linux USB using Mac

mac

CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.

1. Prepare the .iso file

Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file

2. Convert the .iso file into a .img.dmg

@rilian
rilian / restforce.md
Created May 11, 2019 14:48 — forked from Aupajo/restforce.md
How Restforce handles refreshing OAuth tokens

Summary

You can hook into authentication success by passing an authentication_callback to the client.

If you're happy relying on an internal API call, you can make sure your token is fresh by calling:

restforce_client.authenticate!
@rilian
rilian / h2_puma.rb
Created December 14, 2018 14:55 — forked from tenderlove/h2_puma.rb
Demo HTTP/2 server with Puma
require 'socket'
require 'openssl'
require 'puma/server'
require 'ds9'
class Server < DS9::Server
def initialize socket, app
@app = app
@read_streams = {}
@write_streams = {}
@rilian
rilian / test.html
Created August 31, 2018 17:58 — forked from viattik/test.html
FE_Interview_Snippets
<!-- Make all small squares to inside container, 3 in row, 10px padding everywhere -->
<div class="container">
<div class="image"></div>
<div class="image"></div>
<div class="image"></div>
<div class="image"></div>
<div class="image"></div>
<div class="image"></div>
<div class="image"></div>
@rilian
rilian / curl.md
Created August 6, 2018 12:56 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@rilian
rilian / pytest.md
Created March 15, 2018 10:39 — forked from kwmiebach/pytest.md
pytest cheat sheet

Usage

(Remember to create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@rilian
rilian / slackpost
Created February 20, 2018 14:08 — forked from edderrd/slackpost
#!/bin/bash
# Usage: slackpost <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
webhook=PUT_YOUR_HOST_HERE
shift
@rilian
rilian / slackpost
Created February 20, 2018 14:05 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@rilian
rilian / gist:12dcdaded69b5cd26ccf204188c3c6d9
Created July 17, 2017 10:00 — forked from stiucsib86/gist:ebff282a3989f9a24117
Backup MySQL dump to Azure Storage
#!/bin/sh
mkdir /home/bitnami/backups/
export BACKUP_FILE=/home/bitnami/backups/db-backup.sql.gz
export DATABASE_SCHEMA_NAME=--all-databases
export AZURE_CONTAINER=YOUR_VALUE_HERE
export AZURE_NAME=YOUR_VALUE_HERE
export AZURE_KEY=YOUR_VALUE_HERE
export AZURE_BLOB_NAME=db-production-$(date +%Y%m%d%H%M%S).sql.gz
@rilian
rilian / config-environments-test.rb
Last active October 5, 2019 07:49 — forked from keithtom/no_animations.rb
Rack Middleware to disable Disable CSS3/jQuery Animations for Capybara
Rails.application.configure do
# ...
require_relative '../../spec/support/no_animations'
config.middleware.use Rack::NoAnimations
end