Skip to content

Instantly share code, notes, and snippets.

View iKlsR's full-sized avatar
🍃
daemon.

iKlsR

🍃
daemon.
View GitHub Profile
@iKlsR
iKlsR / closeallwithoutsaving.jsx
Created October 19, 2014 22:27
close all open ps tabs without prompting to save
function closeCurrentWithoutSaving() {
if (app.activeDocument.length != 0)
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
function closeAllWithoutSaving() {
while (documents.length != 0) {
for (var i = 0x00; i < documents.length; i++)
documents[i].close(SaveOptions.DONOTSAVECHANGES);
}
@iKlsR
iKlsR / Pascal.sublime-build
Created May 2, 2014 00:10
Pascal build system for st3
{
"cmd": ["fpc", "${file}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.pas",
"variants": [
{
"name": "Run",
"cmd": ["$file_base_name"],
// 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