Skip to content

Instantly share code, notes, and snippets.

View jesperes's full-sized avatar

Jesper Eskilson jesperes

View GitHub Profile
@jesperes
jesperes / xmas-challenge.rb
Last active December 31, 2015 11:59
Ruby script to check challenge compliance with XMAS Challenge 2011: http://coord.info/GC39Q62.
#
# Installation instructions for Nokogiri can be found at
# http://nokogiri.org/tutorials/installing_nokogiri.html
require 'nokogiri'
#
# Usage: ruby xmas-challenge.rb /path/to/MyFinds.gpx
if ARGV.size == 0
puts "Usage: ruby #{$0} /path/to/MyFinds.gpx"
exit 1
@jesperes
jesperes / know-your-local-cachers.rb
Last active January 2, 2016 15:09
Ruby script to check if you are eligible to log the "Know your local cacher". I've used in particular on http://coord.info/GC447Q2, but it should be easily adaptible to other similar caches. It will print a list of all cache owners of which you have logged at least three caches (of a certain) kind.
#
# Installation instructions for Nokogiri can be found at
# http://nokogiri.org/tutorials/installing_nokogiri.html
require 'nokogiri'
#
# Usage: ruby #{$0} /path/to/MyFinds.gpx
if ARGV.size == 0
puts "Usage: ruby #{$0} /path/to/MyFinds.gpx"
exit 1
# Commands to create a case-insensitive NTFS-filesystem on linux
# Disclaimer: run these commands at you own risk!
# Create the image file. Adjust size to your liking.
dd if=/dev/zero of=fs.img bs=1G count=40
# Create the NTFS file system. -F flag is necessary to make mkfs.ntfs accept
# that fs.img is not a block device.
mkfs.ntfs -F fs.img
@jesperes
jesperes / tmux.md
Last active July 10, 2018 07:59
tmux cheatsheet

tmux cheatsheet

Until these commands are in my muscle memory, I keep them here. C-b means, of course, the prefix key.

  • C-b % split pane vertically (into a left and right pane)
  • C-b " split pane horizontaly (into an upper and a lower pane)
  • C-b <arrowkey> switch to another pane
  • C-b C-<arrowkey> enlarge the current pane
  • C-b q show pane numbers (press key to jump to pane)
Debugger entered--Lisp error: (wrong-type-argument consp nil)
  json-serialize((:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params (:settings #<hash-table equal 1/65 0x1430c35>)) :null-object nil :false-object :json-false)
  lsp--make-message((:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params (:settings #<hash-table equal 1/65 0x1430c35>)))
  #f(compiled-function (it) #<bytecode 0x1430d25>)(#s(lsp--workspace :ewoc #s(ewoc :buffer #<buffer *lsp-log: groovy-ls:403828*> :pretty-printer lsp--log-entry-pp :header [[[[... #5 ... #<marker at 4728 in *lsp-log: groovy-ls:403828*>] #4 "" #<marker at 4923 in *lsp-log: groovy-ls:403828*>] #3 DL-LIST #<marker at 4923 in *lsp-log: groovy-ls:403828*>] [#3 [#4 [#5 ... ... #<marker at 4658 in *lsp-log: groovy-ls:403828*>] #s(lsp--log-entry :timestamp "12:35:56 " :process-time 434 :type incoming-resp :method "initialize" :id 5 :body #<hash-table equal 1/1 0x13e1e09>) #<marker at 4084 in *lsp-log: groovy-ls:403828*>] #s(lsp--log-entry :timesta
@jesperes
jesperes / dialyzer1.erl
Last active November 8, 2021 09:37
dialyzer blog post (example 1)
plus_one(X) ->
X + 1.
main() ->
plus_one("string").
@jesperes
jesperes / dialyzer1_output.txt
Created November 8, 2021 09:42
dialyzer blog post example output 1
foo.erl:5:1: Function plus_one/1 has no local return
foo.erl:6:5: The call erlang:'+'
(X :: [103 | 105 | 110 | 114 | 115 | 116, ...],
1) will never return since it differs in the 1st argument from the success typing arguments:
(number(),
number())
@jesperes
jesperes / epgsql.erl
Last active March 3, 2022 07:11
Dialyzer bug in OTP 24.x
-module(epgsql).
-export_type([connect_opts/0]).
-type connect_opts() :: foo:bar(). %% unknown type here