Skip to content

Instantly share code, notes, and snippets.

View thehenster's full-sized avatar

Henry thehenster

  • https://char.gy
  • London
View GitHub Profile
@thehenster
thehenster / netcat-listen-on-port.sh
Last active December 8, 2015 14:40
The nc in Ubuntu doesn't have the same arguments as the normal one
# in normal nc
nc -l -p 8888
# in bsd nc
nc -l 0.0.0.0 8888
# throw in a -k to keep listening to subsequent requests
@charset "utf-8";
@import "normalize";
html {
font-size: 62.5%;
}
body {
font-family: -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
@thehenster
thehenster / time_travel_in_console.rb
Created November 28, 2017 17:55
Time travel in console
[1] pry(main)> require "active_support/testing/time_helpers"
=> true
[2] pry(main)> include ActiveSupport::Testing::TimeHelpers
=> Object
[3] pry(main)> travel_to("1969-01-01".to_time){ puts Time.current }
1969-01-01 00:00:00 +0100
@thehenster
thehenster / config.ru
Created October 30, 2019 22:39
Rackup file for dynamic requests, then static files, then not found
require 'rack'
require 'rack/static'
class App
def initialize(app)
@app = app
end
def call(env)
req = Rack::Request.new(env)