This file contains 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 | |
# Change delimiter for the for each loop from space to newline | |
IFS=$(echo -en "\n\b") | |
countMain=0 | |
countSub=0 | |
# Make a list of all filenames in the game | |
findAllFiles=`find . -type f` |
This file contains 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
const request = async function() { | |
const response = await fetch('https://api.com/route'); | |
const json = await response.json(); // or .text() for simpler data like String | |
console.log(json); | |
} | |
request(); |
This file contains 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
# 1. Take file from Desktop with email contents | |
# 2. curl the mailgun API | |
cat ~/Desktop/email | \ | |
curl -s --user 'api:key-YOURKEYHERE' \ | |
https://api.mailgun.net/v3/YOUR-MAILGUN-DOMAIN/messages \ | |
-F from='Your Name <your.email@gmail.com>' \ | |
-F to='mailgun-list@domain.com' \ | |
-F subject='Gotto change me every time' \ |
This file contains 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
/* | |
This will expand all of the posts and comments that is in the view. It will take a lot of time! | |
To use just paste this in your console (F12). | |
*/ | |
var previousScrollheight = 0 | |
scrollDown = function() { | |
var currentScrollheight = document.body.scrollHeight | |
var canScroll = currentScrollheight - previousScrollheight | |
previousScrollheight = document.body.scrollHeight |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am kristerv on github. | |
* I am kristerv (https://keybase.io/kristerv) on keybase. | |
* I have a public key ASC8yZfPEz4hbu9oakOp3H2nhkGs-GMfpZ4kDanGVStm9wo | |
To claim this, I am signing this object: |
This file contains 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
wget http://out.redwall.ee/rangeforce/kliendile/rangeforce-1.0.zip | |
unzip rangeforce-1.0.zip -d rfweb | |
rm rangeforce-1.0.zip | |
cd rfweb/dist/ | |
# Create Dockerfile | |
cat > ./Dockerfile <<EOL | |
FROM php | |
COPY . /var/www/myapp | |
CMD ["php", "-S", "0.0.0.0:80", "-t", "/var/www/myapp"] |
This file contains 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
[Service] | |
WorkingDirectory=/srv/heliumpay-budgetweb-backend/ | |
ExecStartPre=/usr/bin/git checkout . | |
ExecStartPre=/usr/bin/git pull | |
ExecStartPre=/usr/bin/npm install | |
ExecStart=/usr/bin/nodejs /srv/heliumpay-budgetweb-backend/index.js | |
Restart=always | |
StandardOutput=syslog | |
StandardError=syslog | |
SyslogIdentifier=budgetweb-backend |
This file contains 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
# ZSH | |
apt install -y zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
cat >> ~/.oh-my-zsh/themes/robbyrussell.zsh-theme <<"EOL" | |
PROMPT='%{$fg_bold[green]%}$USER%{$reset_color%} ${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' | |
EOL | |
cat >> ~/.zshrc <<"EOL" | |
zstyle ':completion:*' special-dirs true # ../ tab-completion | |
EOL |
This file contains 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
defmodule Arvuti do | |
def hashit(str, ind, result) do | |
hash = :crypto.hash(:md5 , str <> to_string(ind)) |> Base.encode16() | |
{pos, _} = :string.to_integer(to_char_list(String.slice(hash,5..5))) | |
letter = String.slice(hash, 6..6) | |
cond do | |
isdone(result) -> | |
result | |
String.slice(hash, 0..4) == "00000" && 0 <= pos && pos < 8 && String.slice(result, pos..pos) == "_" -> | |
result = String.slice(result, 0..pos-1) <> letter <> String.slice(result, pos+1..10) |
This file contains 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
defmodule Arvuti do | |
def hashit(str, ind, result) do | |
hash = :crypto.hash(:md5 , str <> to_string(ind)) |> Base.encode16() | |
cond do | |
String.length(result) >= 8 -> | |
result | |
String.slice(hash, 0..4) == "00000" -> | |
result = result <> String.slice(hash, 5..5) | |
IO.puts result | |
hashit(str, ind+1, result) |
NewerOlder