Skip to content

Instantly share code, notes, and snippets.

@b-coimbra
b-coimbra / edit.js
Created December 18, 2017 14:16
makes page editable
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
@b-coimbra
b-coimbra / cyb
Created January 1, 2018 14:45
cyberpunk learning resources
**LEARNING**
http://cybrary.it/
http://n0where.net/
http://www.offensive-security.com/metasploit-unleashed
http://resources.infosecinstitute.com/
http://www.windowsecurity.com/articles-tutorials/
http://www.sans.org/reading-room/
https://www.corelan.be/index.php/articles/
http://opensecuritytraining.info/Training.html
@b-coimbra
b-coimbra / lam.rb
Created January 2, 2018 17:52
lambda clusterfuck
define_method :λ, -> *args, &block { block::(args) }
λ{λ{λ{λ{λ{λ{λ{λ{λ(λ{λ{λ{5}}},λ{λ{2}},λ{λ{4}},λ{λ{5}}){|i|p i}}}}}}}}} # 3 2 4 5

A Complete CS Education Reading List

How Computers Work - A Casual Intro

  1. The Pattern on the Stone - Hills
  2. Code - Petzold

Actual Programming

  1. Haskell Programming From First Principles
  1. Parallel and Concurrent Programming in Haskell
@b-coimbra
b-coimbra / dimensions.rb
Last active January 23, 2018 02:03
Script to rename .png files with their respective dimensions
#!/usr/bin/env ruby
# encoding: UTF-8
Dir['*'].each { |f|
File.rename(f, ((File.binread(f.to_s)[0x10..0x18].unpack('NN')*?x + ' ' + f) if File.extname(f)[/\.png/])) if f != $0
} rescue Errno::ENOENT abort '[!] Run as admin.'
@b-coimbra
b-coimbra / roulette.rb
Created February 2, 2018 00:01
ruby russian roulette
puts (rand(1..3) == 3) && `system -s -f -t 0` || 'Click'
@b-coimbra
b-coimbra / map.cpp
Created February 5, 2018 17:03
ascii player on a map
#include <iostream>
#include <conio.h>
#include <string>
#define KEY_UP 72
#define KEY_DOWN 80
#define KEY_LEFT 75
#define KEY_RIGHT 77
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
@b-coimbra
b-coimbra / fb.rb
Created February 8, 2018 17:49
non-alphanumeric fizzbuzz
_ = $$ / $$ # 1
__ = _ - _ # 0
@_ = _ + _ # 2
$_ = @_ + _ # 3
$__ = @_ + $_ # 5
$-_ = $__ * $_ # 15
@__ = '' << $-_ * ($__ + $_) + @_ # z
$___ = '' << $-_ * $__ - $__ << $-_ * ($__ + @_) << @__ << @__ # Fizz
@___ = '' << $-_ * $__ - $_ * $_ << $-_ * ($__ + $_) - $_ << @__ << @__ # Buzz
@b-coimbra
b-coimbra / image.js
Created February 17, 2018 04:31
script to view images on google
document.onclick = () =>
document.querySelectorAll('.irc_mi').forEach((e) => e.parentNode.href = e.src);
for (let a=[1,2,3][Symbol.iterator](),b; !(b=a.next()).done;) {
console.log(b.value);
}