Skip to content

Instantly share code, notes, and snippets.

View dagbrown's full-sized avatar

Dave Brown dagbrown

View GitHub Profile
@dagbrown
dagbrown / gist:4b1f3b75817096434f7564ce98e8c193
Created March 18, 2020 10:15
Broken ISO build caused by ncurses bump
checking for wctomb... no
checking for mktime... no
checking definition to turn on extended curses functions... unknown
checking for unctrl.h... unctrl.h
checking for flushinp... no
checking for getattrs... no
checking for getbegx... no
checking for getbegy... no
checking for getbegyx... no
checking for getcurx... no
### Keybase proof
I hereby claim:
* I am dagbrown on github.
* I am dagbrown (https://keybase.io/dagbrown) on keybase.
* I have a public key whose fingerprint is 95F0 71A2 AF40 FB7A 0377 EC5B 3E00 3B56 5A8C 22A6
To claim this, I am signing this object:
Python 2.7.7 (default, Jul 19 2014, 21:44:39)
[GCC 4.8.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> [ 1, 2, 3 ] + "hi there"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can only concatenate list (not "str") to list
>>> x = [ 1,2,3 ];x += "hi there"; x
[1, 2, 3, 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e']
>>>
@dagbrown
dagbrown / gist:7409062
Created November 11, 2013 07:01
lol python
Python 2.7.5 (default, Nov 6 2013, 17:10:18)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 5
>>> a > 3
True
>>> a < 3
False
>>> True = 42
>>> True * 2
@dagbrown
dagbrown / how-to-be-an-asshole.py
Created July 10, 2013 04:45
If a computer knows what a person is trying to accomplish, it's not the computer's job to actually do what the person was asking to do. It's the computer's job to tell them the correct way to do what they're obviously trying to do.
def setquit():
"""Define new builtins 'quit' and 'exit'.
These are objects which make the interpreter exit when called.
The repr of each object contains a hint at how it works.
"""
if os.sep == ':':
eof = 'Cmd-Q'
elif os.sep == '\\':
def setquit():
"""Define new builtins 'quit' and 'exit'.
These are objects which make the interpreter exit when called.
The repr of each object contains a hint at how it works.
"""
if os.sep == ':':
eof = 'Cmd-Q'
elif os.sep == '\\':
#!/usr/bin/zsh
DELETE_WAV=true
while true
do
case "$1" in
-r)
shift;
RATE=$1
# robots.txt for http://www.whitehouse.gov/
User-agent: *
Disallow: /cgi-bin
Disallow: /search
Disallow: /query.html
Disallow: /help
Disallow: /360pics/iraq
Disallow: /360pics/text
Disallow: /911/911day/iraq
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/shibuyagi-root
ext4 40G 13G 26G 33% /
/dev/mapper/shibuyagi-boot
ext4 97M 86M 6.3M 94% /boot
/dev/mapper/shibuyagi-dagbrown
ext4 99G 28G 66G 30% /home/dagbrown
tmpfs tmpfs 4.0M 0 4.0M 0% /var/lock
tmpfs tmpfs 4.0M 64K 4.0M 2% /var/run
tmpfs tmpfs 3.0G 0 3.0G 0% /dev/shm
require "complex"; class Complex; def m; z=self; 1024.times {|i|z=z*z+self;
return i+1 if z.abs>2};return 1024 end end;(1.0).step(-1,-0.05) do |y|
(-2.0).step(0.5,0.0315) do |x| print " .,:;~=/$@#"[(Math.log(Complex(x,y).m)/
Math.log(2)).to_i].chr end; puts end