Skip to content

Instantly share code, notes, and snippets.

Antun Karlovac antun

Block or report user

Report or block antun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bundle_with_lodash.js
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
/**
* @license
* lodash 3.10.1 (Custom Build) <https://lodash.com/>
* Build: `lodash modern -o ./lodash.js`
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
View bundle_without_lodash.js
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// var _ = require('./lib/lodash');
console.log("Browserified data loaded");
console.log("If lodash works you should get a random number here: ", _.random(0,5));
},{}]},{},[1]);
View xlsx2csv.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import csv
import sys
import codecs
import pprint
from openpyxl import load_workbook
View jsonp2json
#!/usr/bin/env python
import sys
rawinput = sys.stdin.read()
output = rawinput[ rawinput.index("(") + 1 : rawinput.rindex(")") ]
print(output)
View csv2xlsx.py
#!/usr/bin/env python
"""
FUNCTION: Converts a CSV (tab delimited) file to an Excel xlsx file.
Copyright (c) 2012, Konrad Foerstner <konrad@foerstner.org>
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.
@antun
antun / lzx.vim
Created Feb 23, 2013
OpenLaszlo LZX Sytax file
View lzx.vim
so $VIMRUNTIME/syntax/xml.vim
let b:current_syntax = "lzx"
syn region lzxScript start=+<script>+ end=+</script>+ extend containedin=xmlRegion contains=lzxCData,xmlTag,xmlEqual,xmlEndTag fold keepend
syn region lzxMethod start=+<method+ end=+</method>+ extend containedin=xmlRegion contains=lzxCData,xmlTag,xmlEqual,xmlEndTag fold keepend
syn region lzxEventHandler start=+\Won\w\{-}="+ end=+"+ containedin=xmlTag contains=xmlAttrib,xmlEqual,lzxScriptAttribute,lzxAttributeQuote contained keepend
syn region lzxScriptAttribute matchgroup=lzxAttributeQuote start=+="+ end=+"+ contained
@antun
antun / lctime
Created Feb 15, 2013
Converts time from seconds since 1970 to a human readable date
View lctime
#!/usr/bin/python
import sys, time
if __name__ == '__main__':
args = sys.argv[1:]
for arg in args:
#print arg
print time.ctime( int(arg) )
@antun
antun / xmlunescape
Created Feb 15, 2013
XML unescapes a string
View xmlunescape
#!/usr/bin/python
import sys, xml.sax.saxutils
if __name__ == '__main__':
args = sys.argv[1:]
for arg in args:
print xml.sax.saxutils.unescape( arg )
@antun
antun / xmlescape
Created Feb 15, 2013
XML-encodes a string
View xmlescape
#!/usr/bin/python
import sys, xml.sax.saxutils
if __name__ == '__main__':
args = sys.argv[1:]
for arg in args:
print xml.sax.saxutils.escape( arg )
@antun
antun / urldecode
Created Feb 15, 2013
URL unencodes (decodes) a string passed via command line
View urldecode
#!/usr/bin/python
import sys, urllib
if __name__ == '__main__':
args = sys.argv[1:]
for arg in args:
print urllib.unquote( arg )
You can’t perform that action at this time.