Skip to content

Instantly share code, notes, and snippets.

View lypanov's full-sized avatar

Alexander Kellett lypanov

  • Voorburg, Netherlands
View GitHub Profile
@lypanov
lypanov / elinkify.rb
Created January 9, 2020 22:46
Post-process step using elinks -dump to create OSC-8 style hyperlinked terminal output
require "json"
require "pp"
state = false
references_raw, content = *(`elinks -dump /tmp/dump4`.lines.partition { |line| state = true if line == "References\n" ; state } )
content_began, delayed_link = false, nil
references = references_raw.inject({}) do |hsh, line|
if line =~ /Visible links$/
content_began = true
next hsh
@lypanov
lypanov / README
Last active April 20, 2022 12:58
Inoreader connection README
Hey! Hope you don't mind but actually just need the API for personal usage so no website for it.
It's just a program for looking at my count of stars each day and doing some statistics :)
Maybe I'll release it as open source at some point but quite unlikely it'll ever be that polished.
Hope this is an okay usage! Thank you!
Update for Inoreader: This is actually being used for newsboat also now, but I'm trying my best to limit any pain caused for you!
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.instagram.com/*
// @require http://code.jquery.com/jquery-latest.js
// @grant none
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am lypanov on github.
  • I am lypanov (https://keybase.io/lypanov) on keybase.
  • I have a public key whose fingerprint is F070 9739 60F6 6542 0209 89B1 F5E3 23AF 2EB6 0488

To claim this, I am signing this object:

2012/03/26 : 1.5-dev8
- MINOR: patch for minor typo (ressources/resources)
- MEDIUM: http: add support for sending the server's name in the outgoing request
- DOC: mention that default checks are TCP connections
- BUG/MINOR: fix options forwardfor if-none when an alternative header name is specified
- CLEANUP: Make check_statuses, analyze_statuses and process_chk static
- CLEANUP: Fix HCHK spelling errors
- BUG/MINOR: fix typo in processing of http-send-name-header
- MEDIUM: log: Use linked lists for loggers
- BUILD: fix declaration inside a scope block
(use 'pallet.core)
(use 'pallet.compute)
(use 'pallet.resource)
(use 'pallet.crate.automated-admin-user)
(def mynodes
(pallet.core/node-spec
:image {:os-family :ubuntu :os-version-matches "10.10" :os-64-bit true}))
(def with-wget
(pallet.core/server-spec
[master rails-quick-start] % python -c "import simplejson as json; from chef import *; autoconfigure(); print json.dumps(dict(DataBagItem('apps', 'radiant')));"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Python/2.6/site-packages/chef/data_bag.py", line 51, in __init__
super(DataBagItem, self).__init__(str(bag)+'/'+name, api=api, skip_load=skip_load)
File "/Library/Python/2.6/site-packages/chef/base.py", line 51, in __init__
data = self.api[self.url]
TypeError: 'NoneType' object is unsubscriptable
{
"group": "nogroup",
"repository": "git://github.com/radiant/radiant.git",
"server_roles": [
"radiant"
],
"migrate": {
"production": true
},
"force": {
[Mon, 07 Mar 2011 14:13:38 -0800] DEBUG: Loading cookbook mysql's library file: /var/chef/cache/cookbooks/mysql/libraries/database.rb
[Mon, 07 Mar 2011 14:13:38 -0800] WARN: Missing gem 'mysql'
[Mon, 07 Mar 2011 14:13:38 -0800] DEBUG: Loading cookbook openssl's library file: /var/chef/cache/cookbooks/openssl/libraries/secure_password.rb
[Mon, 07 Mar 2011 14:13:38 -0800] DEBUG: Loading cookbook packages's library file: /var/chef/cache/cookbooks/packages/libraries/packages.rb
[Mon, 07 Mar 2011 14:13:38 -0800] DEBUG: Loading cookbook aws's library file: /var/chef/cache/cookbooks/aws/libraries/ec2.rb
[Mon, 07 Mar 2011 14:13:38 -0800] WARN: Missing gem 'right_aws'
[Mon, 07 Mar 2011 14:13:38 -0800] DEBUG: Loading cookbook radiant's library file: /var/chef/cache/cookbooks/radiant/libraries/radiant.rb
[Mon, 07 Mar 2011 14:13:38 -0800] DEBUG: Loading cookbook mysql's providers from /var/chef/cache/cookbooks/mysql/providers/database.rb
[Mon, 07 Mar 2011 14:13:38 -0800] DEBUG: Loaded contents of /var/chef/cache/cookbook
(use 'clojure.test)
(defn groups-of [n vec]
(cond (<= (count vec) n) [vec]
:else (lazy-seq (cons (subvec vec 0 n) (groups-of n (subvec vec 1))))))
(defn swap [coll i j]
(let [ci (coll i) cj (coll j)]
(assoc coll i cj j ci)))