start new:
tmux
start new with session name:
tmux new -s myname
I hereby claim:
To claim this, I am signing this object:
''' | |
This is an example of how to send data to Slack webhooks in Python with the | |
requests module. | |
Detailed documentation of Slack Incoming Webhooks: | |
https://api.slack.com/incoming-webhooks | |
''' | |
import requests | |
# Set the webhook_url to the one provided by Slack when you create the webhook at |
#!/bin/sh | |
if test -t 1; then exec 1>/dev/null | |
fi | |
if test -t 2; then exec 2>/dev/null | |
fi | |
"$@" & |
# @ your EC2 instance
sudo apt update
sudo apt install openjdk-8-jre unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d android-sdk
sudo mv android-sdk /opt/
export ANDROID_SDK_ROOT=/opt/android-sdk
Using JSON in Postgres by example.
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
=begin | |
Converts: | |
# people.csv | |
Name, Age, Height | |
Ahmed, 12, 103 | |
Mohamed, 19, 176 | |
.. into: | |
# people.json |
module.exports = { | |
hexStringToIntArray: function(str) { | |
var res = [] | |
for(var i = 0; i < str.length; i += 2) { | |
res.push(parseInt(str.substring(i, i+2), 16)) | |
} | |
return res | |
}, | |
byteArrayToHexString: function(array) { |
#!/usr/bin/env ruby | |
# 1. Copy the raw text from https://www.corequran.com/ | |
# 2. Run "ruby parse.rb" | |
# 3. Paste the copied text | |
# 4. Press "Ctrl + D" to see the output | |
def parse(str) | |
str | |
.split("\n") |
const elemsIn = (tag, parent) => Array.from(parent.getElementsByTagName(tag)); | |
const speedUp = (v) => v.playbackRate = 2; | |
const videos = elemsIn('video', document); | |
const iframes = elemsIn('iframe', document); | |
videos.forEach(speedUp); | |
iframes.forEach((f) => elemsIn('video', f.contentWindow.document).forEach(speedUp)); |