Skip to content

Instantly share code, notes, and snippets.

View wmantly's full-sized avatar

William Mantly wmantly

View GitHub Profile
import requests
import json
def get_ip():
res = requests.get('https://wtfismyip.com/json')
return res.json()['YourFuckingIPAddress']
class Godaddy:
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;

The Tower of Hanoi

The Tower of Hanoi is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape.

The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:

  • Only one disk can be moved at a time.

  • Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack.

#!/usr/bin/env ruby
class Node
attr_accessor :data, :next_node
def initialize(data, next_node=nil)
@data = data
@next = next_node
end
#!/usr/bin/env bash
for file in *.avi;
do name=`python3 -c "import re; print(re.sub(r'\.[^\.]+$', '.mp4', '''$file'''))"`;
echo $name;
ffmpeg -i "$file" -movflags +faststart "${name}" && rm "$file";
done
POSITION TITLE: Instructor / Trainer for Software Engineers C++ or Python
SPECIFICATION NUMBER: 69605CRI
LOCATION: New York, New York
COMPENSATION: $150,000 base or market rate + Bonus
COMPANY: Our client is a leader in the Financial Services Industry.
#!/usr/bin/env bash
name=`echo $1 | cut -d'.' -f1`;
echo $name;
ffmpeg -i "$1" -strict -2 "${name}.mp4";
pool: stuffpoll
state: DEGRADED
status: One or more devices could not be used because the label is missing or
invalid. Sufficient replicas exist for the pool to continue
functioning in a degraded state.
action: Replace the device using 'zpool replace'.
see: http://zfsonlinux.org/msg/ZFS-8000-4J
scan: resilvered 4K in 0h0m with 0 errors on Sat May 5 02:57:41 2018
config:

Move to the gitea dir

cd /var/www/gitea/bin

Download the latest linux amd64 release

https://github.com/go-gitea/gitea/releases

wget https://github.com/go-gitea/gitea/releases/download/v<VERSION>/gitea-<VERSION>-linux-amd64

Make the new gitea version executable

chmod +x gitea--linux-amd64

Data access layer

The files in this folder access the database and API's in a standard manner.

  • This is the only place in the project where query's are written and use.
  • No app logic should be used here.
  • Only app.config and app.database should be imported in theses files.
  • These files should only be consumed in the models files.

The files here should be names after tables, collections or API's.