Skip to content

Instantly share code, notes, and snippets.

View rilian's full-sized avatar

rilian rilian

View GitHub Profile
@rilian
rilian / setup.md
Last active June 7, 2024 18:25
boinc-related
@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 / convert-json-to-csv-in-folder.sh
Created July 2, 2021 15:38
convert JSON to CSV in folder
#!/bin/bash
for filename in *.json; do
cat "$filename" | jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' > "$filename.csv"
done
@rilian
rilian / NEW-users.js
Last active May 22, 2019 20:58
functions example for SO comment.
const app = require("express")();
app.get("/users/:id", (req, res) => {
// return user json by id
}
@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