Skip to content

Instantly share code, notes, and snippets.

View Jerakin's full-sized avatar
🔥
Makin'

Jerakin

🔥
Makin'
View GitHub Profile
@Jerakin
Jerakin / ps-export-layers-to-png.jsx
Last active January 6, 2020 12:31 — forked from tomekc/ps-export-layers-to-png.jsx
Photoshop script that exports to PNG all layers and groups whose names end with ".png".
#target photoshop
// $.level = 2;
/*
* Script by Tomek Cejner (tomek (at) japko dot info)
* based on work of Damien van Holten:
* http://www.damienvanholten.com/blog/export-groups-to-files-photoshop/
*
* My version adds support of nested layer groups,
* and exports single layers in addition to groups.
REM My main disk
D:
REM Defold project
cd "D:\Defoldx86\branches\34041\2444\app"
REM Build with bob
java -jar "D:\Defoldx86\branches\34041\2444\app\tools\build\bob.jar" --archive --platform "armv7-android" --bundle-output "C:\Users\mattias\Desktop\builds" --debug distclean build bundle
REM Move to adb folder
@Jerakin
Jerakin / timer.lua
Created December 20, 2016 08:50
Defold, Lua timer module
-- A timer module for Defold, supports a regular timer and a repeating timer,
-- timer fires its callback once, the repeating timer fire its callback until it is canceled
-- Locals
local M = {}
------------------------------------------------------------------------------
function M.create()
local self = {}
# Implementation of Brian Khuu's progress bar from http://stackoverflow.com/questions/3160699/python-progress-bar
# with some small tweaks to formatting
#
# Accepts a float between 0 and 1. Any int will be converted to a float.
# A value under 0 represents a 'halt'.
# A value at 1 or bigger represents 100%
#
# Usage
#for i in len(10):
# progressbar.update_progress((i+1)/len(10))
@Jerakin
Jerakin / defold_animation_curves_2016.py
Last active January 19, 2018 09:27
Script to export custom animation curves from maya to be used in defold
"""
MAYA 2016 Version
Hack for making custom animations in Defold, animate in Maya then export the animation as a curve.
The script will save every frame as a point on the curve, so try to use as few keys in maya as possible.
Set the "animate to" to 1 and the time to how ever long you want the animation to be. Something like below
go.animate("go", "position.x", go.PLAYBACK_LOOP_PINGPONG, 1, vmath.vector(transform_x), 5.0)
go.animate("go", "position.y", go.PLAYBACK_LOOP_PINGPONG, 1, vmath.vector(transform_y), 5.0)
"""
@Jerakin
Jerakin / screeninfo.lua
Created November 14, 2017 10:09
Defold screen helper
-- Initiate it in your game.render_script by adding this to its init()
-- screeninfo.init(render.get_window_width(), render.get_window_height())
local M = {}
local window_width
local window_height
local project_widht
local project_height
@Jerakin
Jerakin / luacheck_std.luacheckrc
Last active April 29, 2021 22:33
Luacheck and Defold
return {
stds = {
defold = {
read_globals = {
"go", "gui", "msg", "url", "sys", "render", "factory", "particlefx", "physics", "sound", "sprite", "image",
"tilemap", "vmath", "matrix4", "vector3", "vector4", "quat", "hash", "hash_to_hex", "hashmd5", "pprint",
"iap", "facebook", "push", "http", "json", "spine", "zlib", "collectionfactory",
"__dm_script_instance__", "socket", "adtruth", "jit", "bit", "window", "webview", "profiler", "resource",
"collectionproxy", "label", "model", "timer", "zlib", "html5", "buffer", "crash", "bit32",
"RenderScriptConstantBuffer", "RenderScriptPredicate", "RenderScript", "GuiScript", "GuiScriptInstance"
@Jerakin
Jerakin / builder.py
Last active July 9, 2018 18:24
For building and deploying Defold projects directly to your phone
"""
Builder is built by wrapping adb and storing some data locally
I would recommend to add an alias to your ~.bash_profile to use it easier
alias builder="python3.5 ~/Documents/repo/builder/builder.py"
Usage:
builder.py [command] [arguments]
Available Commands:
build build [location of a project]
install install [path to APK]
uninstall uninstall [bundle id]
@Jerakin
Jerakin / swedbank_to_ynab
Created December 31, 2017 02:22
Converting Swedbanks exported excel document to a format readable by you need a budget.
"""
Converting Swedbanks exported excel document to a format readable by you need a budget.
"""
import csv
import os
import pandas as pd
bank_file = r"C:\Users\Jerakin\Desktop\Kontohistorik.xls"
@Jerakin
Jerakin / delete_obsolete_resources.py
Last active March 6, 2018 16:57
Remove obsolete assets from a gui file
import deftree
import os
import sys
def run_on_file(project_path, gui_file):
tree = deftree.parse(gui_file)
output = []
output.extend(clean_textures(tree))