Skip to content

Instantly share code, notes, and snippets.


Matus Lestan madvas

View GitHub Profile
madvas / handlers.cljs
Created Oct 3, 2016
re-frame :blockchain/unlock-account
View handlers.cljs
(fn [{:keys [db]} [address password]]
{:web3 (:web3 db)
:fns [[web3-personal/unlock-account address password 999999
madvas / SimpleTwitter.sol
Created Oct 3, 2016
Solidity SimpleTwitter
View SimpleTwitter.sol
pragma solidity ^0.4.1;
import "strings.sol";
contract SimpleTwitter {
using strings for *;
address public developer;
uint16 public maxTweetLength;
uint16 public maxNameLength;
madvas / cljs-react-material-ui-reagent-example.cljs
Created May 13, 2016
Snippet example of using library cljs-react-material-ui with Reagent
View cljs-react-material-ui-reagent-example.cljs
(ns crmui-reagent.core
[cljs-react-material-ui.core :as ui]
[cljs-react-material-ui.reagent :as rui]
[cljs-react-material-ui.icons :as ic]
[reagent.core :as r :refer [atom]]
[reagent.session :as session]
[secretary.core :as secretary :include-macros true]
[accountant.core :as accountant]
madvas / partial-right.clj
Created Jun 13, 2015
Clojure partial-right (Like a partial, but arguments are added to the end)
View partial-right.clj
(defn partial-right
"Takes a function f and fewer than the normal arguments to f, and
returns a fn that takes a variable number of additional args. When
called, the returned function calls f with additional args + args."
([f] f)
([f arg1]
(fn [& args] (apply f (concat args [arg1]))))
([f arg1 arg2]
(fn [& args] (apply f (concat args [arg1 arg2]))))
([f arg1 arg2 arg3]
madvas / gist:2669f893f1bce329161a
Created May 7, 2015
Applescript command + Tab function
View gist:2669f893f1bce329161a
on cmdTab()
tell application "System Events"
key down command
keystroke tab
key up command
end tell
end cmdTab
madvas / gist:8e1d8c680a35a2d45b09
Created May 6, 2015
Applescript escape XML special chars
View gist:8e1d8c680a35a2d45b09
on escapeString(toEscape)
set res to replaceChars(toEscape, "\"", """)
set res to replaceChars(res, "'", "'")
set res to replaceChars(res, "&", "&")
set res to replaceChars(res, ">", ">")
set res to replaceChars(res, "<", "&lt;")
return res
end escapeString
on replaceChars(this_text, search_string, replacement_string)