Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
$ git branch -r --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
class CheckOut | |
def initialize(rules) | |
@items = Hash.new { 0 } | |
@pricer = Pricer.new(rules) | |
end | |
def scan(sku) | |
@items[sku] += 1 | |
end |
module Abilities | |
def self.ability_for(user) | |
if user.admin? | |
AdminAbility.new(user) | |
else user | |
MemberAbility.new(user) | |
else | |
GuestAbility.new | |
end | |
end |
class Proc | |
def |(g) | |
lambda {|*args| | |
g.(self.(*args)) | |
} | |
end | |
end | |
class Printer |
import java.util.*; | |
import java.io.*; | |
import java.security.*; | |
public class ChangePassword | |
{ | |
private final static JKS j = new JKS(); | |
public static void main(String[] args) throws Exception | |
{ |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
#!/bin/bash | |
# This script reads text from stdin, generates its QR code and splits it into two visual cryptographic images. Both images appear random and have as many whites as blacks. Only when print on transparent film (or extremely thin paper) and superposed, the ciphered qrcode appears as gray/black dots. | |
# We use the program "qrencode" to generate a QR at an average 7% error-correction rate ("low" quality; the lowest available). We create then a random array and we visual-XOR it with the QR code to retrieve the ciphered code. Only the random array (nonce or one-time pad) and the ciphered array are recorded, and only when both are superposed they reveal the QR code. | |
# The visual-cryptographic scheme used is inspired of http://leemon.com/crypto/VisualCrypto.html . It transforms 0s and 1s into diagonal 2x2 squares (01\10 and 10\01). The visual XOR either repeats (gray superposition; corresponding to a white dot) or flips (black superposition; corresponding to a black dot), following the QR code. | |
# Security |
#!/bin/bash -eu | |
# Download, configure and install Ruby and Bundler on a Debian-family or Redhat-family fresh system | |
# https://gist.github.com/infertux/a5252bf8023f0a0e9380 | |
RUBY="2.2.2" | |
SHA256="5ffc0f317e429e6b29d4a98ac521c3ce65481bfd22a8cf845fa02a7b113d9b44" | |
# This runs as root on the server | |
[ $UID -eq 0 ] |
DROP TABLE IF EXISTS parent; | |
DROP TABLE IF EXISTS child; | |
CREATE TABLE parent( | |
identity_id integer, | |
valid_range int4range | |
); | |
CREATE TABLE child( | |
valid_range int4range, |