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
background no | |
alignment top_right | |
gap_x 20 | |
gap_y 20 | |
default_color cornflowerblue | |
default_outline_color white | |
default_shade_color white |
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
xset m 3/2 4 |
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
// The idea is to load a placeholder popup right after the click | |
// and then redirect it later to the real location. | |
// on click | |
let popup = showPlaceholderPopup('Loading...'); | |
api.get('/obtain-the-real-url').then(url => { | |
popup.location.href = url; | |
}); |
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
#--------------------------------------------- | |
# Newlines before and after each prompt line | |
#--------------------------------------------- | |
function pre_command() { | |
printf "\n" | |
} | |
function post_command() { | |
printf "\n" | |
} |
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
# /etc/profile | |
# go lang | |
export PATH=$PATH:/usr/local/go/bin | |
export GOPATH=$HOME/Desktop/go | |
export PATH=$PATH:$GOPATH/bin |
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
// https://docs.djangoproject.com/en/1.11/ref/csrf/#ajax | |
$.ajaxSetup({ | |
beforeSend: function(xhr, settings) { | |
if (!csrfSafeMethod(settings.type) && !this.crossDomain) { | |
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); | |
} | |
} | |
}); |
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
host_public_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip | |
setup_ssh = <<SCRIPT | |
mkdir -p /home/ubuntu/.ssh | |
echo '#{host_public_key}' >> /home/ubuntu/.ssh/authorized_keys | |
SCRIPT | |
install_python = 'DEBIAN_FRONTEND=noninteractive apt-get install -y python' | |
Vagrant.configure('2') do |config| |
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
#!/bin/bash | |
if [ ! -d ".env" ]; then | |
virtualenv -p `which python3` .env | |
fi | |
source .env/bin/activate |
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
git config --global alias.l "log --graph --abbrev-commit --decorate --format=format:'%C(blue)%h%C(reset) %C(white)%s%C(reset) %C(dim white)- %an [%ar]%C(reset)%C(cyan)%d%C(reset)' --all" |
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
# watch -n 1 python3 -m unittest bug.py | |
from unittest import TestCase | |
from http.cookies import SimpleCookie | |
class BugTestCase(TestCase): | |
def test_bug(self): | |
morsel = list(SimpleCookie('token=abc; HttpOnly; SameSite=Strict').values())[0] |
NewerOlder