I hereby claim:
- I am victorloux on github.
- I am vloux (https://keybase.io/vloux) on keybase.
- I have a public key whose fingerprint is 8C6F F63A 1546 296E BB61 D59A FC34 34E9 DCBD 68E1
To claim this, I am signing this object:
<?php | |
/** | |
* This is a sort of “inline”, more readable if-then-echo statement | |
* for Blade in Laravel, mainly used for dynamically adding classes | |
* or attributes to HTML elements. | |
* | |
* The syntax is | |
* | |
* (( [classname] if [condition] )) |
// place the following in app/Providers/AppServiceProviders.php, in the boot() method | |
/** | |
* Blade directive to dump a variable/object inside a template. | |
* This is similar to dd(), except that it doesn't interrupt the | |
* execution of the app. It does NOT support multiple arguments | |
* however, you have to use one directive per variable. | |
* | |
* @example @dump($posts->comments) | |
*/ |
I hereby claim:
To claim this, I am signing this object:
/* | |
* Re-maps a number from one range to another, akin to map() in Processing and Arduino | |
* | |
* @param {Number} value The number to map | |
* @param {Number} inMin The lower bound of the value's current range | |
* @param {Number} inMax The upper bound of the value's current range | |
* @param {Number} outMin The lower bound of the value's target range | |
* @param {Number} outMax The upper bound of the value's target range | |
* @param {boolean} capped Set to true to cap to the min/max target range, even if the input was outwith the current range | |
* |
// Note: this is MacOS X only, keep that in mind if you want something portable | |
// but it's a very easy way to prototype a project using TTS | |
// Possible voices: "Agnes", "Albert", "Alex", "Bruce", "Fiona", "Fred", "Kathy", | |
// "Princess", "Ralph", "Vicki", "Victoria" | |
// Weird voices: "Bad News", "Bahh", "Bells", "Boing", "Bubbles", "Cellos", "Deranged", | |
// "Good News", "Hysterical", "Junior", "Pipe Organ", "Trinoids", "Whisper", "Zarvox" | |
// | |
// to see all installed voices, in a terminal type: `say -v ?` |
This is a short guide to set up an Intel Galileo (or alternatively a Yún, or other small embedded systems who can run Linux) to connect to a wi-fi network, and particularly an eduroam network. Note that if you're using a Raspberry Pi I've found that it's significantly easier to use NetworkManager to do that, but this might not work on Yocto Linux.
(These notes were written in 2014 so they may be outdated by easier processes.)
FIRST you need to have your Galileo set up with the full Linux image (on a microSD card) and a working access to the terminal (via USB or UART). (If you're on OSX or Linux you're probably better off using screen
, worked better than CoolTerm which didn't support backspaces and vi). There's plenty of tutorials online to do this. All commands here have to be typed in the terminal of the Galileo.
I must thank Sergey Malinov's guide and [the wiki of Archlinux](https://wiki.archlinux.org/index.php/WPA_
#!/bin/sh | |
# | |
# Put in .git/hooks/post-merge on your remote (staging or production) | |
# and chmod +x on it. | |
# Combine with a GH webhook script that will `git pull` | |
# every time you push to a repo | |
# If you get errors with a webhook script, note you might | |
# have to change the owner of your repository (+ log file) to "www-data" or similar |
# this creates the command "cr" which will cd into the most recently created directory | |
# useful after using mkdir, git clone, unzip etc. | |
# no need to type "mkdir new-project && cd new-project" | |
# just "mkdir new-project" then "cr"! | |
# !! WORKS ON macOS only (Linux doesn't have creation times) | |
# but it can surely be adapted with some hack on the modified time | |
alias cr=cd (ls -tUd */ | head -n 1) |
/** | |
* Polyfill to make aria-current work with Android | |
* This happens on page load, re-run if loading content dynamically. | |
* Ensure you have a class .sr-only in your CSS | |
* | |
* (wtfpl) github.com/victorloux | |
*/ | |
// Test if the browser is an Android Chrome | |
if(/Android/.test(navigator.userAgent) && /Chrome\/[.0-9]*/.test(navigator.userAgent)) |
a[href], | |
area[href], | |
input:not([disabled]), | |
select:not([disabled]), | |
textarea:not([disabled]), | |
button:not([disabled]), | |
iframe, | |
[tabindex], | |
[contentEditable=true] | |
{ |