Skip to content

Instantly share code, notes, and snippets.

@vordan
vordan / new_gist_file_0
Last active January 16, 2016 10:38
Export на ценовник од Google Spreadsheet за web сајт на Инфопројект
- Во Google Spreadsheet, избери File->Download as->Web page (zip)
- Отпакувај го зипот
- Отвори го фајлот со ценовникот (нпр. основни-модули.html)
- Отвори го фајлот resources/sheet.css и копирај ја целата содржина (вообичаено, има еден ред)
- Во датотеката со ценовникот
- Стави таг <style type="text/css">
- На почетокот, вметни го копираниот CSS
- После тоа, вметни го следниов код:
.waffle {overflow-x:scroll;overflow-y:visible;width:100%;margin-left: 238px;}
th:first-child, thead {display:none;}
@vordan
vordan / multi_dashboard.html
Created January 31, 2016 08:35 — forked from battlehorse/multi_dashboard.html
A Google Charts dashboard setup where multiple datatables are used to power a single 'logical' dashboard.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>
Google Visualization API Sample
</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['controls']});
@vordan
vordan / accent-pf550.js
Last active June 27, 2023 16:25
Kodovi za rabota so fiskalen printer na Accent PF-550 (PF-500)
var codes_pf500 = {
adjust_date : Chr(61), // 3D
open_smetka : Chr(48), // 30
close_smetka : Chr(56), // 38
open_storno : Chr(85), // 55
close_storno : Chr(86), // 56
stavka : Chr(49), // 31
vtor_red : Chr(10), // 0A
kraj_opis : Chr(9), // 09
@vordan
vordan / expand_div.php
Created May 5, 2016 19:18
jQuery expanding a div
<style>
#jQ, #van {
width:76px;
height:76px;
padding:24px;
border:2px solid;
border-radius:8px;
cursor:pointer;
}
@vordan
vordan / cnv
Created May 25, 2016 18:41
Convert Image Formats On Command Line
for i in *.jpg;
do
convert "$i" "${i%.*}.tif";
done
@vordan
vordan / domIsReady.js
Created February 19, 2017 15:20 — forked from devbyray/domIsReady.js
Vanilla JavaScript Document Ready (Cross-Browser)
var domIsReady = (function(domIsReady) {
var isBrowserIeOrNot = function() {
return (!document.attachEvent || typeof document.attachEvent === "undefined" ? 'not-ie' : 'ie');
}
domIsReady = function(callback) {
if(callback && typeof callback === 'function'){
if(isBrowserIeOrNot() !== 'ie') {
document.addEventListener("DOMContentLoaded", function() {
return callback();
@vordan
vordan / gist:0dd0e382e6d1dfe277a05254f1cdf3ad
Created February 21, 2017 20:37 — forked from tleen/gist:5110817
Format a Javascript Date to HTML5 time element datetime using moment.js
var html5datetime = moment(yourDate).format('YYYY-MM-DDTHH:mm:ssZ')
@vordan
vordan / new_gist_file_0
Created March 14, 2017 18:04
Disable Insecure Login Field Warning in Firefox
security.insecure_field_warning.contextual.enabled = false
signon.autofillForms.http = true
@vordan
vordan / nzBool.js
Created March 26, 2017 13:32
nzBool function
function nzBool(val, def_val) {
var ret_val = val;
if (typeof def_val == "undefined" || def_val === null || def_val.length === 0) {
def_val = false;
}
if (typeof(val) == "undefined" || val === null || val.length === 0)
ret_val = def_val;
else if (typeof(val) == 'number')
@vordan
vordan / purge-old-kernels.sh
Last active April 6, 2017 09:37
Remove old kernel versions to clean up the boot menu
#!/bin/bash
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'|grep -E "(image|headers)" | xargs sudo apt-get -y purge