This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use common::sense; | |
use AnyEvent; | |
use AnyEvent::HTTP; | |
use JSON; | |
# Get your API key here: | |
# http://imgur.com/register/api_anon | |
my $imgur_api_key = '69696969696969696969696969696969'; # XXX - replace me | |
my $imgur_upload = 'http://api.imgur.com/2/upload.json'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $country = shift; | |
die("Usage: block <COUNTRY>\n") unless $country; | |
# Examples: | |
# block Russia < GeoIPCountryWhois.csv > deny_russia.list | |
# block Poland < GeoIPCountryWhois.csv > deny_poland.list | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"created_at": "Mon Jan 01 16:02:46 +0000 2018", | |
"id": 947860662130110500, | |
"id_str": "947860662130110464", | |
"text": "Coin of the week; https://t.co/p55OUIL9qC", | |
"display_text_range": [ | |
0, | |
17 | |
], | |
"source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tue Dec 26 13:59:51 +0000 2017 | officialmcafee 961445378 | Coin Of The Day: https://t.co/WSTXaha1Nk | |
[ 'Coin Of The Day: https', | |
'https', | |
index: 0, | |
input: 'Coin Of The Day: https://t.co/WSTXaha1Nk' ] | |
COIN OF THE DAY! Coin Of The Day: https://t.co/WSTXaha1Nk { found: false, | |
reason: 'Couldn\'t find https in currencies list.' } | |
{ found: false, | |
reason: 'Couldn\'t find https in currencies list.' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mon Dec 25 13:59:59 +0000 2017 | officialmcafee 961445378 | Coin of the day: Humaniq (HMQ). In the spirit of Christmas, there is no better coin. Their mission is true to the v… https://t.co/aPoKRqBcqR | |
[ 'Coin of the day: Humaniq ', | |
'Humaniq ', | |
index: 0, | |
input: 'Coin of the day: Humaniq (HMQ). In the spirit of Christmas, there is no better coin. Their mission is true to the v… https://t.co/aPoKRqBcqR' ] | |
COIN OF THE DAY! Coin of the day: Humaniq (HMQ). In the spirit of Christmas, there is no better coin. Their mission is true to the v… https://t.co/aPoKRqBcqR { found: true, symbol: 'HMQ', name: 'Humaniq' } | |
attempting to buy HMQ | |
{ success: true, | |
message: '', | |
result: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bin/repl | |
> bot.btcSpend | |
0.001 | |
> bot.btcSpend = 0.25 | |
0.25 | |
> bot.adjustment = 0.05 | |
0.05 | |
> bot.init() | |
Promise { | |
undefined, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ | |
var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromChar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 2013-11-29 SOLVED | |
(defn p53-longest-increasing-sub-seq [s] | |
(let [begin-sequences | |
(fn [s] (rest (reductions (fn [a b] (conj a b)) [] s))) | |
end-sequences | |
(fn [s] (reverse (reduce (fn [mem a] (conj (map (fn [b] (flatten [b a])) mem) (list a))) [] s))) | |
longest | |
(fn [s] (reduce (fn [longest x] (if (> (count x) (count longest)) x longest)) [] s))] | |
(->> (apply concat (map begin-sequences (end-sequences s))) | |
(filter (fn [s] (apply < s))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# step 1 - compile perl {{{ | |
/root/perl5/perlbrew/perls/perl-5.16.3/bin/perl /root/p/bin/perlbrew install perl-5.18.1 --notest -Dusethreads -Duselargefiles -Dcccdlflags=-fPIC -Dpager=/usr/bin/sensible-pager -Doptimize=-O2 -Duseshrplib -Dcf_by=Dave -Dcf_email=dave@instantchannelinc.com -Duse64bitall -Darchname=x86_64-linux-gnu -Dccflags=-DDEBIAN | |
# }}} | |
# step 2 - install cpan modules with newly compiled perl {{{ | |
PERL5=/root/perl5/perlbrew/perls/perl-5.18.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert-statement = (table, obj) -> | |
columns = keys obj | |
value-set = [ "$#{i+1}" for k,i in columns ].join ', ' | |
vals = values obj | |
return ["INSERT INTO #table (#columns) VALUES (#value-set) RETURNING *", vals] | |
update-statement = (table, obj, wh) -> | |
wh ?= "WHERE id = $1" | |
ks = keys obj |> filter (-> it isnt \id) | |
obj-vals = [ obj[k] for k in ks ] |
NewerOlder