Skip to content

Instantly share code, notes, and snippets.

View ixth's full-sized avatar
🎯
Focusing

Mikhail Menshikov ixth

🎯
Focusing
View GitHub Profile
@ixth
ixth / path_complete.lua
Created May 28, 2011 15:45
Path autocompletion script for SciTE
-- Path autocompletion script for SciTE
-- Opens autocomplete dialogue for selected path string
SCI_SUBSTITUTE_PATH = 1987
function hasbit(x, p)
return x % (p + p) >= p
end
function TrimPath(p)
if p:sub(1, 1) == '/' then p = p:sub(2) end
@ixth
ixth / xml2json.js
Created May 22, 2011 13:05
Library for xml to json conversion
/*
fuck copyrights, i just need working lib
*/
(function (global) {
function serializeNode(xmlNode) {
var jsonNode = {};
if (xmlNode.attributes) {
for (var i = 0, length = xmlNode.attributes.length; i < length; i++) {
@ixth
ixth / python_grid.py
Created May 21, 2011 15:07
GIMP plugin: Add guides according to 960px 12 column grid
#!/usr/bin/env python
from gimpfu import *
GRID_COLUMNS = 12
GRID_COLUMN_WIDTH = 80
GRID_WIDTH = GRID_COLUMNS * GRID_COLUMN_WIDTH
def python_grid(image, draw, guide_1, guide_2):
image.undo_group_start();
@ixth
ixth / includeTemplate.inc.php
Created April 24, 2011 14:42
Snippet to include template files from file system
<?php
# Not my own, found it here: http://modxcms.com/forums/index.php?topic=40053
# Snippet to include template files from file system
# USAGE: [[includeTemplate? &tpl=`mytemplate/template.html`]]
if ( !isset($tpl) || $tpl== "" ) return "Missing Template file!";
$tpl = $base_path . 'assets/templates/' . $tpl;
ob_start();
include($tpl);