Skip to content

Instantly share code, notes, and snippets.

Beothorn beothorn

Block or report user

Report or block beothorn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@beothorn
beothorn / awslambda
Created Nov 19, 2019
lambda request ec2
View awslambda
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 Jan 24, 2018
Configuring cygwin find/grep on windows for spacemacs
View .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 Jan 20, 2018
Enhances shadows from given image args: original destination brightness
View enhanceShadows.py
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 Jan 17, 2018
Render a .blend file in all sizes needed for android
View renderAndroidAssets.sh
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 / objectToJava.py
Last active Aug 29, 2015
This is a blender script to convert an object to a literal java array
View objectToJava.py
import bpy
'''
This is a blender script to convert an object to a literal java array
'''
result = "static float coords[] = {\n"
current_obj = bpy.context.active_object
View PirateBayExample.java
package webGrude;
import webGrude.annotations.Page;
import webGrude.annotations.Selector;
import java.util.List;
public class PirateBayExample {
@Page("http://thepiratebay.se/search/{0}/0/7/0")
View PrintExampleSearchResults.java
import webGrude.annotations.Page;
import webGrude.annotations.Selector;
import java.util.List;
public class PrintExampleSearchResults {
@Selector("")
public static class SearchResult{
@Selector(".result-title") public String resultTitle;
View SearchResultWithoutAnnotations.java
public class SearchResult{
public String resultTitle;
public String resultContent;
}
View SearchResultPageWithAnnotations.java
import webGrude.annotations.Page;
import webGrude.annotations.Selector;
public class PrintExampleSearchResults {
@Page("http://www.example.com/{0}")
public static class SearchResultPage {
@Selector("h1") public String header;
}
View SearchResultPageWithoutAnnotations.java
public class SearchResultPage {
public String header;//this field will contain the page header
}
You can’t perform that action at this time.