Skip to content

Instantly share code, notes, and snippets.

iex(22)> exif
[JPEGInterchangeFormatLength: [7164], JPEGInterchangeFormat: [862],
ResolutionUnit: [2], YResolution: [{72, 1}], XResolution: [{72, 1}],
Compression: [6], Software: ['Adobe Photoshop CS4 Macintosh'],
ResolutionUnit: [2], YResolution: [{2400000, 10000}],
XResolution: [{2400000, 10000}], Orientation: [1], Model: ['NIKON D80'],
Make: ['NIKON CORPORATION']]
iex(23)> JSON.encode(exif)
** (ArgumentError) argument error
:erlang.apply(72, :to_keywords, [])
iex(1)> rec = :erl_img.load("/tmp/img.01052272347D8C5DA78E655299E8176")
{:ok,
{:erl_image, :image_gif, :undefined,
"/tmp/img.01052272347D8C5DA78E655299E8176", :undefined, :undefined,
:undefined, :undefined, [], :palette8, 400, 212, 8, 3, 1,
[ApplicationIdentifier: 'XMP Data', ApplicationAuthenticationCode: 'XMP',
ApplicationData: <<63, 120, 112, 97, 99, 107, 101, 116, 32, 98, 101, 103, 105, 110, 61, 34, 239, 187, 191, 34, 32, 105, 100, 61, 34, 87, 53, 77, 48, 77, 112, 67, 101, 104, 105, 72, 122, 114, 101, 83, 122, 78, 84, 99, 122, 107, 99, 57, 100, 34, ...>>,
ApplicationIdentifier: 'NETSCAPE', ApplicationAuthenticationCode: '2.0',
ApplicationData: <<1, 0, 0>>, Background: 255, AspectRatio: 0, Sort: 0],
:left_to_right,
@eraserewind
eraserewind / free-mobile-sms.zsh
Last active August 29, 2015 14:02
Send SMS to yourself using Free Mobile's SMS notifications API.
FREE_MOBILE_SMS_USER="..."
FREE_MOBILE_SMS_PASS="..."
function self-sms {
setopt extendedglob
encoded="${${(j: :)@}//(#b)(?)/%$[[##16]##${match[1]}]}"
curl -q https://smsapi.free-mobile.fr/sendmsg\?user\=${FREE_MOBILE_SMS_USER}\&pass\=${FREE_MOBILE_SMS_PASS}\&msg\=${encoded}
}
# self-sms hello my friend how are you\?
@eraserewind
eraserewind / programme-tv.css
Last active August 29, 2015 14:04
programme-tv.net css fix.
#videoPush { display:none }
#newsPush { display:none }
#sidebar { display:none }
#header { display:none }
#col_left { width: 100% }
.channel .programme .readmore { display:none }
.block.sondages { display:none }
.baseline, .footer-layout, .sf-extensionfactory-link { display:none }
begin
wait_for_miracle do |miracle|
return miracle.proof_that_god_exists
end
rescue Timeout::Error => e
return e.proof_that_god_exists
end
@eraserewind
eraserewind / onlinenet_debian_ipv6.md
Last active October 24, 2021 03:47
Online.net: IPv6 in Debian virtual machines

Online.net: IPv6 in Debian virtual machines

Without this annoying dribbler thing.

Variables

  • RANGE = /64
  • EXT_IF = external interface
  • IPV6 = Any IPv6 in RANGE
  • DUID = dhcp client id. Find it in console.online.net
### Keybase proof
I hereby claim:
* I am eraserewind on github.
* I am jbracco (https://keybase.io/jbracco) on keybase.
* I have a public key whose fingerprint is 8891 E1E7 26CC 8030 4B84 885A E89A 181D 331D 2B12
To claim this, I am signing this object:
@eraserewind
eraserewind / prout.md
Last active March 8, 2017 11:40
{topo,geos} vs. {hipe,beam} vs. {atom,xeon}

tl;dr

build   cpu    benchmark name                               iterations   average time
BEAM   Xeon   Topo.contains?(@north_america, @usa)                100   14693.69 µs/op 
HiPE   Xeon   Topo.contains?(@north_america, @usa)                100   11093.37 µs/op -3600.319
C      Xeon   GEOS.contains(@north_america, @usa)            10000000   0.19 µs/op     -14693.5

BEAM   Xeon   Topo.contains?(@north_america, @russia)             100   26424.66 µs/op
HiPE   Xeon   Topo.contains?(@north_america, @russia)             100   17096.10 µs/op  -9328.560