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
extends Node | |
class_name TileNavigation | |
var discarded: Array | |
export var speed: float = 60.0 | |
func pos_to_tile_pos(pos: Vector2, cell_size: Vector2 ) -> Vector2: | |
var x : int = floor(pos.x / cell_size.x) * cell_size.x | |
var y : int = floor(pos.y / cell_size.y) * cell_size.y |
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
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 |
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
--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 |
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
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 |
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
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 |
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 boto3 | |
import datetime | |
import os | |
import json | |
def test_instance(ec2_client): | |
ec2_client.request_spot_instances( | |
DryRun=False, | |
SpotPrice='0.02', | |
ClientToken='string', |
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
;;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) |
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
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)) |
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
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 |
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 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 |