Skip to content

Instantly share code, notes, and snippets.

View funivan's full-sized avatar
⌨️
deliver bits

Ivan Shcherbak funivan

⌨️
deliver bits
View GitHub Profile
@funivan
funivan / gist:5575668
Last active December 17, 2015 07:49
jquery.ukrtranslit.js
(function($){
/**
* 1.0
* Author Ivan Scherbak dev@funivan.com
* $('#title').ukrtranslit('#sef');
*
*/
$.fn.extend({
ukrtranslit : function(el) {
var translitTable = new Array();
@funivan
funivan / save.js
Created June 18, 2013 08:55
Pocket new feature
// Just add this text to bookmark panel
javascript:(function () {ISRIL_SCRIPT = document.createElement('SCRIPT');ISRIL_SCRIPT.type = 'text/javascript';ISRIL_SCRIPT.src='http://localhost/Fiv/tools/saveForFun/save.js';document.getElementsByTagName('head')[0].appendChild(ISRIL_SCRIPT)})();
// Next content save to http://localhost/Fiv/tools/saveForFun/save.js
//
@funivan
funivan / save.php
Created June 18, 2013 08:58
Save pages
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
class ExportHtml {
const SAVE_DIR = '/home/ivan/Ubuntu One/saved';
@funivan
funivan / CatchErrors.php
Last active December 27, 2015 10:59
errors
<?
set_error_handler('exceptions_error_handler');
function exceptions_error_handler($severity, $message, $filename, $lineno) {
if (error_reporting() == 0) {
return;
}
if (error_reporting() & $severity) {
throw new ErrorException($message, 0, $severity, $filename, $lineno);
<?
/**
* https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Process/PhpExecutableFinder.php#L49
*/
if ($php = getenv('PHP_PEAR_PHP_BIN')) {
if (is_executable($php)) {
return $php;
}
}
@funivan
funivan / custom_urls.py
Last active August 29, 2015 14:08
custom urls file location
# -*- coding: UTF-8 -*-
from __future__ import with_statement
__kupfer_name__ = _("Custom urls")
__kupfer_sources__ = ("CustomUrlSource", )
__description__ = _("Navigate to custom urls from list")
__version__ = "0.0.1"
__author__ = "Ivan Scherbak <dev@funivan.com>"
import gtk
// gcc -o v8 v8.c && chmod +x v8 && sudo ./v8
// cat /proc/bus/input/devices
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <linux/input.h>
@funivan
funivan / phpstorm64.vmoptions
Created March 2, 2015 08:22
phpstorm64.vmoptions
-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=225m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
@funivan
funivan / pidgin-move-chat-top.py
Created March 27, 2015 08:07
Move chat to top
#!/usr/bin/env python
#
# Remember you need dbus session to run this program.
# export DBUS_SESSION_BUS_ADDRESS=`cat /proc/$(pidof gnome-session)/environ | tr '\\0' '\\n' | grep DBUS_SESSION_BUS_ADDRESS | cut -d '=' -f2-`;
#
import socket
import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
import os
import sys
#!/bin/bash
fps=7
avconv -start_number 0035 -f image2 -r $fps -i %04d.JPG -q:v 1 -b:v 1000K time-lapse.avi
a=1
for i in *.JPG; do
new=$(printf "%04d.JPG" ${a}) #04 pad to length of 4