Skip to content

Instantly share code, notes, and snippets.

View remi's full-sized avatar
👋

Rémi Prévost remi

👋
View GitHub Profile
@remi
remi / intensify.sh
Created August 31, 2023 15:02
intensify.sh
#!/bin/bash
#
# Call this script, passing an image filename
# Creates an intensified version
convert='convert'
realpath='realpath'
# flight check: must have imagemagick
if [ ! $(which $convert) ]; then
@remi
remi / apple-news.sh
Last active April 14, 2022 05:39
Extract canonical URL from Apple News URL
#!/bin/bash
# Usage:
#
# 1. Create a `apple-news` file somewhere in your $PATH with the content of this file
# 2. That’s it! You can now use the `apple-news` utility:
#
# ```
# $ apple-news https://apple.news/AKoDCWtVEQP2w7Ld657lgIg
# https://www.theguardian.com/technology/2022/mar/30/dyson-launches-zone-air-purifying-bluetooth-headphones-with-visor
defmodule Example1 do
@default_now DateTime.utc_now()
def foo(now \\ @default_now) do
IO.puts(now)
end
end
defmodule Example2 do
def foo(now \\ DateTime.utc_now()) do
@remi
remi / shc.js
Last active March 2, 2022 14:32
Extract JSON object from https://smarthealth.cards QR code
// Extract JSON payload from SHC QR code (without any kind of private/public key verification)
// Credits + inspiration
// https://github.com/dvci/health-cards-walkthrough/blob/main/SMART%20Health%20Cards.ipynb
// Usage
// $ node shc.js "shc:/01234569…"
const zlib = require("zlib");

Keybase proof

I hereby claim:

  • I am remi on github.
  • I am remi (https://keybase.io/remi) on keybase.
  • I have a public key whose fingerprint is 0EB8 6575 1221 3709 D835 08F6 2601 D146 D7E8 4CB5

To claim this, I am signing this object:

import Ember from 'ember';
export default Ember.Component.extend({
nativeArrayItems: Ember.computed(() => []),
emberArrayItems: Ember.A(),
actions: {
addItemInEmberArrayUsingPushObject() {
this.get('emberArrayItems').pushObject(Math.random());
},
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@remi
remi / crypto-ticker-html.sh
Last active January 20, 2018 18:43
Bitcoin + Ethereum shell ticker to use with GeekTool on macOS
#!/usr/bin/env bash
# This script requires `curl`, `jq`, `xargs` `bc` and `awk`
add_arrows() {
foo=$(echo $1 | sed -e 's/^\([0-9]\)/▲ \1/g')
foo=$(echo $foo | sed -e 's/^-/▼ /g')
echo $foo
}
@remi
remi / ClassNameBuilder.js
Last active September 26, 2016 11:39
BEM-style class name builder
// @example
// build('foo', {bar: true, baz: false, omg: true});
// => 'foo foo--bar foo--omg'
const build = (base, modifiers = {}) => {
const reduceModifier = (memo, modifier) => {
return modifiers[modifier]
? memo.concat([`${base}--${modifier.replace(/([A-Z])/g, (part) => `-${part.toLowerCase()}`)}`])
: memo;
};
* {
font-family: 'Roboto', sans-serif !important;
}
html {
font-size: 100%;
line-height: 1.4;
}
.qp {