Skip to content

Instantly share code, notes, and snippets.

View voldmar's full-sized avatar

Volodymyr Epifanov voldmar

View GitHub Profile
@voldmar
voldmar / fill.clj
Created March 27, 2017 13:39
Filling PDF AcroForm with Clojure and iText 7 community edition POF
#!/usr/bin/env boot
; vim: set ft=clojure:
(set-env! :dependencies
'[[com.itextpdf/forms "7.0.2"]])
(import
'[com.itextpdf.forms PdfAcroForm]
'[com.itextpdf.kernel.pdf PdfDocument PdfReader PdfWriter]
'[java.io IOException])
@voldmar
voldmar / brew-total.zsh
Last active March 25, 2016 12:27
Brew command for total updating all your installed packages including casks
#!/usr/bin/env zsh
# Put it to /usr/local/bin/brew-total and use as `brew total`
brew update && brew upgrade --all && brew cleanup
brew cask list | xargs brew cask install && brew cask cleanup
caskroom=/opt/homebrew-cask/Caskroom
for cask in $caskroom/*
do
@voldmar
voldmar / gist:7d86ece6f1b37d274767
Last active August 29, 2015 14:20
AppleScript interface to typograf.artlebedev.ru
on ProcessText(sentence)
tell application "http://typograf.artlebedev.ru/webservices/typograf.asmx"
return call soap {method name:"ProcessText", method namespace uri:"http://typograf.artlebedev.ru/webservices/", parameters:{|m:text|:sentence as string, |m:useP|:false as boolean, |m:useBr|:false as boolean, |m:entityType|:3 as integer}, SOAPAction:"http://typograf.artlebedev.ru/webservices/ProcessText"}
end tell
end ProcessText
set answer to ProcessText("миру - мир")
display dialog answer
@voldmar
voldmar / dabblet.css
Created May 17, 2014 13:51
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@voldmar
voldmar / dabblet.css
Created March 7, 2013 07:50
Untitled
ul {
list-style: none;
padding: 0;
margin: 0;
}
input:checked + label {
background: yellow;
}
@voldmar
voldmar / gist:5089123
Created March 5, 2013 09:43
How To Find A Software Idea And Pre-Sell It Before It’s Built
Andrew: Coming up, today’s guest failed and then he did one thing differently and then he succeeded. I won’t tell you what that one thing is, but if you catch this interview all the way through the end you’ll know it for yourself, and if could have just as big an impact on your life. Also, notice the grin on today’s guest when he tells you how he got a high end develop shop to help him design the look, the feel, the features of his mobile app. You’ll understand why he’s grinning and then I want to know from you, is it something that you’d want to do to get your product developed? Finally how do you get strangers to tell you what to build for them and then to plunk down their credit cards and pay for it. All that and so much more is coming up.
Before we get started I want to congratulate Mixergy fan, Brad Mills, for creating this, Nuvia Cafe. He says he did it while listening to Mixergy interviews based on what he learned from those interviews. Can you imagine the first time by the way that an idea that he ha
from decimal import Decimal as D
from math import ceil
eur = D(387)
rub = D(15516.52)
convert = D(0.774893452150329) / D(31.192)
converted = D(ceil(float(rub * convert)))
print eur, converted
@voldmar
voldmar / reload.applescript
Created August 23, 2012 13:59
Script for reloading first Google Chrome tab with given prefix
#!/usr/bin/osascript
on run argv
set theUrl to "http://localhost:8000/api/"
if (count of argv) > 0 then
set theUrl to item 1 of argv
if not (theUrl starts with "http://" or theUrl starts with "https://") then
set theUrl to "http://" & theUrl
end if
end if
tell application "Google Chrome"
voldmar@work ~/temp % python rus.py
TEXT_RU
9.3005130291
6.33021712303
0.310887098312
0.146034002304
0.112301826477
TEXT_EN
7.99509000778
4.40287303925
@voldmar
voldmar / dabblet.css
Created May 27, 2012 11:51 — forked from smmurf/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
div {
border: 1px solid red;
width: 300px;
height: 300px;
position: relative;
}