Skip to content

Instantly share code, notes, and snippets.

View iKlsR's full-sized avatar
😲
daemon.

iKlsR

😲
daemon.
View GitHub Profile
// units setup, doesn't matter eventually
var originalUnit = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
// create a new document (size doesn't matter)
var docRef = app.documents.add(128, 128);
// get the current layer (background)
var topLayer = app.activeDocument.layers[0];
app.activeDocument.activeLayer = topLayer;
// rename/unlock it as it is locked by default
app.activeDocument.activeLayer.name = 'Unlocked';
@iKlsR
iKlsR / _.md
Created June 8, 2013 04:37
test_001
@iKlsR
iKlsR / scoda.el
Last active December 16, 2015 09:39
my emacs color scheme
(defun color-theme-scoda ()
"Color theme by iKlsR, created 2013-04-16."
(interactive)
(color-theme-install
'(color-theme-scoda
;;;;;;;;
((background-color . "#1e1e1e")
(background-mode . dark)
(border-color . "black")
(cursor-color . "#000000")
@iKlsR
iKlsR / sqr_decorator.py
Created January 5, 2013 00:44
decorator example..
# A decorator is a function that takes another function object as an argument
# and returns said function object as a return value..
def addone(func):
"""squares anything passed to it"""
def modfunc(n):
func(n)
print '> and squared it is', n ** 2
return modfunc
@iKlsR
iKlsR / sdl_boilerplate.c
Created January 2, 2013 23:32
boilerplate for sdl.. (portable..)
#include <SDL/SDL.h>
void _dispatch(SDL_Event e, bool * r) {
while (SDL_PollEvent (&e)) {
switch (e.type) {
case SDL_QUIT:
*r = false;
break;
}
}
@iKlsR
iKlsR / sstack.cpp
Created December 30, 2012 16:01
a very very simple stack..
#include <iostream>
#include <string>
using namespace std;
template <class _st> class stack {
public:
stack();
void push(_st i);
@iKlsR
iKlsR / pine.asm
Created December 24, 2012 04:04
early beginnings of a bootloader.. codenamed PINE
; -- nasm -f bin pine.s -o pine.bin
; -- copy pine.bin pine.img
; -- boot!
[BITS 16] ; make this into 16bit code
[ORG 0x7C00] ; load into memory here
_main:
mov ax, 0x0000 ; setup the data segment register (step1)
mov ds, ax ; move ax into ds (step2)
@iKlsR
iKlsR / vim_in_a_(shell)
Created December 22, 2012 07:31
working_with_vim
start vim
while editing is not finished, repeat
navigate to desired position in NORMAL mode
enter INSERT mode by pressing i
type text
exit INSERT mode by pressing <ESCAPE>
when editing is finished, type :wq
sourced from : http://37.200.69.165/doku.php?id=llthw:ex1
@iKlsR
iKlsR / x86_x64_asm_build.sublime-build
Created December 19, 2012 20:42
x86_64 assembly build system for sublime text 2
{
"cmd": ["nasm", "-f", "bin", "${file}", "-o", "${file_path}/${file_base_name}.COM"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}"
}
// syntax for cmdline building : http://www.nasm.us/xdoc/2.10.06/html/nasmdoc2.html#section-2.1
// syntax for sublime build system : http://sublimetext.info/docs/en/reference/build_systems.html (outdated)?
// replace nasm and update switches as needed.. ;ie.. fasm etc
// ${file} refers to the current saved file.. ${file_path} etc..
@iKlsR
iKlsR / cmingw.bat
Created October 17, 2012 14:54
my special build script for blender x64 with mingw64 having mingwx86(in path) and cygwin then compress
@echo off
echo INFO -- mingw64/bin added to path
set Path=C:\mingw64\bin;%PATH%
echo INFO -- navigating to cygwin/bin
cd ../../../cygwin/bin
echo INFO -- moving troublesome sh.exe to tmp dir
move sh.exe C:\Users\iKlsR