Skip to content

Instantly share code, notes, and snippets.

View anoxic's full-sized avatar
🐙
working on it all at once

Bad Sir Brian anoxic

🐙
working on it all at once
View GitHub Profile
<?php
class Twig_Extension_Less extends \Twig_Extension {
public function getName() {
return 'less';
}
public function getFunctions() {
return array(
'css' => new \Twig_Function_Method($this, 'less_css'),
);
@anoxic
anoxic / bibleqe.rb
Last active December 15, 2015 22:59
Creates and and search an index, returning lines from the original file.
class Text
attr_reader :index, :text, :symbol
def initialize(name, dir = :texts)
raise TextNotFoundError, "Can't find #{name}.txt" unless File.exists? "./#{dir}/#{name}.txt"
Index.new(name, dir) unless File.exists? "./#{dir}/#{name}.ind"
@text = File.new("./#{dir}/#{name}.txt")
@index = File.new("./#{dir}/#{name}.ind")
@symbol = name
@anoxic
anoxic / quotation
Last active March 24, 2017 23:58
Quotation
God is looking for people with whom He can do the impossible -
what a pity we plan only the things we can do ourselves.
A. W. Tozer
Television enables you to be entertained in your home by people you wouldn't have in your home.
David Frost
@anoxic
anoxic / Ruby
Last active December 26, 2017 06:48
Ruby notes
--
Files
Get a file f = File.new("testfile")
Get line number f.lineno # note: you can't seek with lineno
Get a line f.gets # equal to the var $_
Read each line f.each { |line| puts "#{f.lineno}: #{line}" }
# note: after using .each on a file once, you must .rewind the file
Into an array arr = f.readlines
Get a line quickly arr[3]
<?php
class SaltedHash {
protected $salt;
protected $active_hash;
const SALT_LENGTH = 15;
function __construct($hash=null) {
$this->active_hash = $hash;
@anoxic
anoxic / devices
Last active December 18, 2018 04:05
My devices
luisa: Red iMac
s.m.caps: Dell Inspiron
toto: iBook G4
dasha: Thinkpad R61
senko: Kindle 4
intma: Kindle 4
mmtq: 11" Macbook Air 2011
??: Thinkpad
mksv: Mac Mini
tintin: Kindle Paperwhite
@anoxic
anoxic / neuton.md
Last active December 16, 2015 14:29
Neuton Tidbits

When did you create Neuton?

I started in 2009, with most of the work on it being between 2010-2011.

What was your motivation/inspiration for Neuton?

I had certain ideas about letterforms, for a font that I myself would find useful. I knew I wanted something somewhat traditional, but with a healthy combination of modernness, attitude, and friendliness.

@anoxic
anoxic / passwords.lst
Last active December 16, 2015 15:19
Bad passwords
http://blog.jimmyr.com/Password_analysis_of_databases_that_were_hacked_28_2009.php
http://blog.jimmyr.com/Most_Common_Passwords_20_2008.php
use a captcha after 10 attempts
any password that == another password in the system
a password that == firstname
a password that == ANY common firstname
a password that == username
repeat letters
123456, 123, 123123, 01234, 2468, 987654, etc
123abc, abc123, 246abc
@anoxic
anoxic / setup.sh
Last active December 17, 2015 00:39
My install commands for a new ubuntu server
#### Basic things
passwd # Update the root password
apt-get update && apt-get upgrade # Update packages and system
# Install some standard utilities
apt-get install vim zsh git tmux netcat aptitude
chsh -s /bin/zsh # Change shell to zsh
select-editor # and editor to vim
@anoxic
anoxic / hello.rb
Last active December 17, 2015 05:29
class Person
def initialize(name)
@name = name
end
def greet
"Hi there, #{@name}!"
end
end
end