Skip to content

Instantly share code, notes, and snippets.

View beothorn's full-sized avatar

Beothorn beothorn

View GitHub Profile
@beothorn
beothorn / .tigrc
Created July 8, 2020 12:07
My tigrc
bind status P !git push origin
bind status x !mv %(file) /tmp
bind main R !git reset --soft %(commit)
bind main P !git pull -r
--SELECT
-- *
--FROM
-- crime_scene_report
--WHERE
-- date = 20180115
-- AND city = 'SQL City'
-- AND type = 'murder'
--Security footage shows that there were 2 witnesses. The first witness
--lives at the last house on "Northwestern Dr". The second witness, named
@beothorn
beothorn / seq.js
Last active May 28, 2020 15:36
playing around a joke sequence
var next = (numberString) =>{
const count = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for(c of numberString){
count[parseInt(c)]++
}
let nextString = ""
for(c of numberString){
if(count[parseInt(c)] > 0){
nextString += count[parseInt(c)] + c
count[parseInt(c)] = 0
@beothorn
beothorn / awslambda
Created November 19, 2019 21:56
lambda request ec2
import boto3
import datetime
import os
import json
def test_instance(ec2_client):
ec2_client.request_spot_instances(
DryRun=False,
SpotPrice='0.02',
ClientToken='string',
@beothorn
beothorn / .spacemacs
Created January 24, 2018 19:10
Configuring cygwin find/grep on windows for spacemacs
;;Using cygwin
(setq find-program "\"C:/cygwin64/bin/find.exe\"")
(setq grep-program "\"C:/cygwin64/bin/grep.exe\"")
;; Prevent issues with the Windows null device (NUL)
;; when using cygwin find with rgrep.
(defadvice grep-compute-defaults (around grep-compute-defaults-advice-null-device)
"Use cygwin's /dev/null as the null-device."
(let ((null-device "/dev/null"))
ad-do-it))
(ad-activate 'grep-compute-defaults)
@beothorn
beothorn / enhanceShadows.py
Created January 20, 2018 18:43
Enhances shadows from given image args: original destination brightness
from PIL import Image, ImageFilter, ImageChops, ImageEnhance
import sys
original_img = sys.argv[1]
dest_img = sys.argv[2]
mask_strength = sys.argv[3]
original = Image.open(original_img)
gray = original.convert("LA")
blurred = gray.filter(ImageFilter.GaussianBlur(radius=5))
@beothorn
beothorn / renderAndroidAssets.sh
Created January 17, 2018 18:02
Render a .blend file in all sizes needed for android
if [ -z "$1" ]
then
echo ".blend logo file as argument"
fi
blender -b $1 -S XXXHDPI -o //mipmap-xxxhdpi/ -a -S XXHDPI -o //mipmap-xxhdpi/ -a -S XHDPI -o //mipmap-xhdpi/ -a -S HDPI -o //mipmap-hdpi/ -a -S MDPI -o //mipmap-mdpi/ -a
mv ./mipmap-xxxhdpi/0001.png ./mipmap-xxxhdpi/ic_launcher.png
cp ./mipmap-xxxhdpi/ic_launcher.png ./mipmap-xxxhdpi/ic_launcher_round.png
mv ./mipmap-xxhdpi/0001.png ./mipmap-xxhdpi/ic_launcher.png
cp ./mipmap-xxhdpi/ic_launcher.png ./mipmap-xxhdpi/ic_launcher_round.png
@beothorn
beothorn / gist:6685234
Created September 24, 2013 14:02
Linux system information mega dump
echo "#################################Temperature"
sensors
echo "#################################Space available"
df -h
echo "#################################Processes"
ps aux
echo "#################################Processes system usage"
top -b -n 1
echo "#################################List open files"
lsof -i
@beothorn
beothorn / somaextrato.js
Created October 1, 2011 05:10
soma extrato
var indexes = {date:0,description:3,valueSign:6,value:5,balance:7};
var sums = new Array();
function allMonthsSummed(){
console.log("allMonthsSummed");
var divMenuAno = document.getElementById('TRNnoprint03');
var values = document.createElement("textarea");
values.style.width = "100%";
values.style.height = "25em";
for(var i in sums)
@beothorn
beothorn / toogle-compiz
Created May 30, 2011 17:30
Toogle compiz on off
#!/bin/sh
if pidof compiz; then
metacity --replace&
else
compiz --replace&
fi