Skip to content

Instantly share code, notes, and snippets.

View usametov's full-sized avatar

Ulan Sametov usametov

  • Asta Nova Enterprise Solutions
View GitHub Profile
(ns clojure-elasticsearch.core
(:require [clojurewerkz.elastisch.rest :as esr]
[clojurewerkz.elastisch.rest.index :as idx]
[clojurewerkz.elastisch.rest.document :as doc]
[clojurewerkz.elastisch.query :as q]))
(def index-name "test")
(def type "articles")
(def query "third")
@usametov
usametov / ecverify.sol
Created September 8, 2020 22:51 — forked from axic/ecverify.sol
Ethereum ECVerify
//
// The new assembly support in Solidity makes writing helpers easy.
// Many have complained how complex it is to use `ecrecover`, especially in conjunction
// with the `eth_sign` RPC call. Here is a helper, which makes that a matter of a single call.
//
// Sample input parameters:
// (with v=0)
// "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad",
// "0xaca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf200",
// "0x0e5cb767cce09a7f3ca594df118aa519be5e2b5a"
@usametov
usametov / sentiment.fs
Created January 26, 2019 02:52 — forked from sudipto80/sentiment.fs
Sentiment Analysis
open System.Text.RegularExpressions
type SentiWordNetEntry = {POS:string; ID:string; PositiveScore:string; NegativeScore:string; Words:string}
let sentiWordList = System.IO.File.ReadAllLines(@"SentiWordNet_3.0.0_20130122.txt")
|> Array.filter (fun line -> not (line.StartsWith("#")))
|> Array.map (fun line -> line.Split '\t')
|> Array.map (fun lineTokens -> {POS = lineTokens.[0];
ID = lineTokens.[1];
PositiveScore = lineTokens.[2].Trim();
@usametov
usametov / mls.py
Last active July 19, 2018 16:36 — forked from DenisCarriere/mls.py
MLS Scraper
import geocoder
import requests
import unicodecsv as csv
import time
container = {}
g = geocoder.google("Ontario, Canada")
url = "https://api-pr.realtor.ca/Listing.svc/PropertySearch_Post"
PropertySearchType = {
@usametov
usametov / destructuring.js
Created April 1, 2018 14:44 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@usametov
usametov / export-chrome-bookmarks.js
Created October 29, 2017 02:44 — forked from bgrins/export-chrome-bookmarks.js
Reminder of how to export bookmarks from Chrome as text.
/*
Export bookmarks from Chrome as text.
Go to Bookmarks Manager->Organize->Export to HTML file.
Then open that file, open console and run this command:
*/
[].map.call(document.querySelectorAll("dt a"), function(a) {
return a.textContent + " - " + a.href
}).join("\n");
@usametov
usametov / chrome-bookmarks
Created May 12, 2017 02:23 — forked from selvan/chrome-bookmarks
Chrome extension to export all bookmarks
//manifest.json
{
"name": "bookmark-search-export",
"version": "1.0",
"manifest_version": 2,
"description": "This extention will dump all bookmarks",
"browser_action": {
"default_icon": "icon.png"
},
"background": {