- save agnoster-light.zsh-theme to
~/.oh-my-zsh/themes/
. - edit
ZSH_THEME
in~/.zshrc
toagnoster-light
- change the color theme of terminal to
solarized-light
- open a new terminal
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 | |
# see https://carstenwindler.de/php/enable-xdebug-on-demand-in-your-local-docker-environment/ | |
if [ "$#" -ne 1 ]; then | |
SCRIPT_PATH=`basename "$0"` | |
echo "Usage: $SCRIPT_PATH enable|disable" | |
exit 1; | |
fi | |
# Expects service to be called app in docker-compose.yml |
60 Seconds backwards timer with counter
i=60;while [ $((i--)) -gt 0 ]; do printf "\r%02d" $i;sleep 1;done;echo
300 Seconds countdown with spinner
i=300;while [ $((i--)) -gt 0 ]; do for s in / - \\ \|; do printf "\r%03d %s" $i $s;sleep .25;done;done;echo
Import .env file into current shell
No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.
Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.
- A Russian translation of this article can be found here, contributed by Timur Demin.
- A Turkish translation can be found here, contributed by agyild.
- There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
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
<?php | |
$digits = 6; | |
$interval = 30; | |
$secret = 'secret_key'; | |
$prevTotp = ''; | |
for ($i = 0; $i < $interval * 4; $i++) { | |
$time = time(); | |
$counter = (string) floor($time / $interval); | |
$hmac = hash_hmac('sha1', $counter, $secret); |
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
<?php | |
$header = '{"alg":"HS256","typ":"JWT"}'; | |
$payload = '{"sub":"1234567890","name":"John Doe","role":"user"}'; | |
$encodedHeader = base64url_encode($header); | |
$encodedPayload = base64url_encode($payload); | |
$signature = hash_hmac('sha256', "{$encodedHeader}.{$encodedPayload}", 'secret', true); | |
$signedSignature = base64url_encode($signature); | |
$jwt = join('.', [$encodedHeader, $encodedPayload, $signedSignature]); |
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
float decel(float x) { // as an easing function | |
return 1-(x-1)*(x-1); | |
} | |
void setup() { | |
background(255); | |
size(750,750,P2D); | |
PImage img = loadImage("image.png"); | |
strokeWeight(2); | |
noFill(); |
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
<?php | |
/** | |
* Matt: core | |
* Trixor: object handling | |
* lech: Windows suppport | |
* simivar: null support | |
* | |
* @see http://php.net/manual/en/function.print-r.php | |
**/ | |
function print_r_reverse($input) { |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
NewerOlder