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
import asyncio | |
import traceback | |
from discord.ext import commands | |
from googleapi import GoogleApi | |
VM_ARGS = { | |
"instance": "", | |
"project": "", | |
"zone": "" |
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
# https://github.com/Rapptz/discord.py | |
# pip install discord.py | |
import discord | |
from discord.ext import commands | |
# https://github.com/dead-beef/markovchain | |
# pip install markovchain | |
from markovchain.text import MarkovText, ReplyMode | |
bot = commands.Bot(command_prefix='!') |
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
// factorial tail recursive (Elixir style) | |
// 4! means 1*2*3*4, we can ignore 1, which makes it 2*3*4 = 24 | |
def factorial(num), do: factorial(num, 1) | |
defp factorial(num, _product) when num < 0, do: raise ArithmeticError | |
defp factorial(num, product) when num <= 1, do: product | |
defp factorial(num, product), do: factorial(num - 1, product * num) |
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
for img in *; do | |
convert $img -quality 20% -verbose compressed_$img | |
done |
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
# Terminal title, blue path name, orange git branch name, newline, green dollar sign. | |
PS1="\[\e]0;\u@\h: \w\a\]\[\033[01;34m\]\w/ \[\033[38;5;166m\]\$(__git_ps1 '(%s)')\n\[\033[01;32m\]\$ \[\033[00m\]" | |
# example: | |
# ~/my-project/ (master) | |
# $ cd docs | |
# ~/my-project/docs/ (master) | |
# $ |
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
Sub CodeFormat() | |
If Selection.range.Start = Selection.range.End Then | |
MsgBox "You havn't selected any text" | |
Exit Sub | |
End If | |
Dim i As Long | |
Dim j As Long | |
Dim PrimaryList | |
Dim SecondaryList |