Skip to content

Instantly share code, notes, and snippets.

View Derfirm's full-sized avatar

Andrew Grinevich Derfirm

View GitHub Profile
lucca_mission_group = {
slot = 1
generic = no
ai = yes
potential = {
tag = LUC
}
has_country_shield = yes
# missions will go here
#!/bin/bash
echo “Remove Sophos Home”
sudo pkill -9 “Sophos*”
sudo rm -r /Library/Sophos\ Anti-Virus
sudo rm -r /Library/Sophos Anti-Virus
sudo rm -r /Library/LaunchDaemons/com.sophos.*
sudo rm -r /Library/LaunchAgents/com.sophos.*
sudo rm -r /Library/Preferences/com.sophos.*
sudo rm -r /Library/Logs/Sophos\ Anti-Virus.log
sudo rm -r ~/Library/Logs/Sophos\ Anti-Virus/Scans/
@Derfirm
Derfirm / specification.py
Created March 17, 2020 15:37 — forked from palankai/specification.py
Python Specification Pattern
class Specification:
def __and__(self, other):
return And(self, other)
def __or__(self, other):
return Or(self, other)
def __xor__(self, other):
return Xor(self, other)
@Derfirm
Derfirm / gist:3c0e087e14d6b5230c577db255099ce4
Created March 7, 2019 16:40 — forked from nhoad/gist:8966377
Async stdio with asyncio
import os
import asyncio
import sys
from asyncio.streams import StreamWriter, FlowControlMixin
reader, writer = None, None
@asyncio.coroutine
def stdio(loop=None):
@Derfirm
Derfirm / Makefile
Created February 13, 2019 10:15 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
mimes_map = {
'txt': 'text/plain',
'htm': 'text/html',
'html': 'text/html',
'php': 'text/html',
'css': 'text/css',
'js': 'application/javascript',
'json': 'application/json',
'xml': 'application/xml',
'swf': 'application/x-shockwave-flash',
@Derfirm
Derfirm / youtube api video category id list
Created November 3, 2018 21:49 — forked from dgp/youtube api video category id list
youtube api video category id list
2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
@Derfirm
Derfirm / encode.sh
Created October 27, 2018 20:35 — forked from mikoim/README.md
YouTube recommended encoding settings on ffmpeg (+ libx264)
#/bin/sh
ffmpeg -i input -c:v libx264 -preset slow -profile:v high -crf 18 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low output
litecoin_difficulty = 250000
farm_hashrate = 500e6
initial_block = 50
def calculate_block_time_found(difficulty, hashrate):
return difficulty * 2**32 / hashrate
#!/usr/bin/env python
from __future__ import division
import random
import itertools
from collections import OrderedDict, defaultdict
def flip_coin():
return random.randint(0, 1)