Skip to content

Instantly share code, notes, and snippets.

@eglaysher
eglaysher / mandelbrot.hoon
Last active February 23, 2020 20:26
Fixed-point (not floating point!) Mandelbrot generator in Hoon.
:: Mandelbrot implementation inspired by the fixed-point version for
:: uBasic/4tH, and the floating point version for PureBasic from
:: https://rosettacode.org/wiki/Mandelbrot_set. This is pure fixed-point.
::
:: The trick is to use 10.000 as "floating" 1.0, and then do all math in terms
:: of that.
::
|%
++ left-edge -21.000
++ right-edge --15.000

Keybase proof

I hereby claim:

  • I am eglaysher on github.
  • I am eglaysher (https://keybase.io/eglaysher) on keybase.
  • I have a public key ASBznvmQnhchCJZlUX5TuakLTVBUj3BSnXCsS5GOTEq91Qo

To claim this, I am signing this object:

@eglaysher
eglaysher / gist:8486590
Created January 18, 2014 05:29
make expectations failure.
$ ./make_expectations.py
Traceback (most recent call last):
File "./make_expectations.py", line 375, in <module>
sys.exit(Main(sys.argv))
File "./make_expectations.py", line 244, in Main
if int(jsondata['rev']) <= revb:
ValueError: invalid literal for int() with base 10: 'Force the Chromium revision'
@eglaysher
eglaysher / gist:5861540
Created June 25, 2013 19:25
license check break for phajdan-jr
testing/iossim/third_party/class-dump: missing README.chromium or licenses.py SPECIAL_CASES entry
third_party/GTM: License file not found. Either add a file named LICENSE, import upstream's COPYING if available, or add a 'License File:' line to README.chromium with the appropriate path.
third_party/android_tools: missing README.chromium or licenses.py SPECIAL_CASES entry
third_party/aosp: missing README.chromium or licenses.py SPECIAL_CASES entry
third_party/apache-mime4j: missing README.chromium or licenses.py SPECIAL_CASES entry
third_party/findbugs: missing README.chromium or licenses.py SPECIAL_CASES entry
third_party/freetype: missing README.chromium or licenses.py SPECIAL_CASES entry
third_party/httpcomponents-client: missing README.chromium or licenses.py SPECIAL_CASES entry
third_party/httpcomponents-core: missing README.chromium or licenses.py SPECIAL_CASES entry
third_party/jarjar: missing README.chromium or licenses.py SPECIAL_CASES entry
@eglaysher
eglaysher / gist:859542
Created March 7, 2011 23:49
golang has problems compiling cgo; can't find fflush or fputs?
--- cd ../misc/cgo/stdio
rm -rf *.o *.a *.[568vq] [568vq].out hello fib chain run.out *.so _obj _test _testmain.go *.exe _cgo* *.cgo[12].*
CGOPKGPATH= cgo -- align.go file.go test.go test1.go
touch _obj/_cgo_run
6g -o _go_.6 _obj/align.cgo1.go _obj/file.cgo1.go _obj/test.cgo1.go _obj/test1.cgo1.go _obj/_cgo_gotypes.go
6c -FVw -I/home/erg/go/pkg/linux_amd64 -I . -o "_cgo_defun.6" _obj/_cgo_defun.c
gcc -m64 -I . -g -fPIC -O2 -o _cgo_main.o -c _obj/_cgo_main.c
gcc -m64 -I . -g -fPIC -O2 -o align.cgo2.o -c _obj/align.cgo2.c
gcc -m64 -I . -g -fPIC -O2 -o file.cgo2.o -c _obj/file.cgo2.c
gcc -m64 -I . -g -fPIC -O2 -o test.cgo2.o -c _obj/test.cgo2.c
@eglaysher
eglaysher / count_sizediff.py
Created October 15, 2010 19:05
Script used to measure differences in size of object files
#!/usr/bin/python
#
# Script used to measure differences in size of object files
#
# $ make -j15 chrome
# $ find out/Debug/ -name "*.a" | xargs ls -s > before.txt
# --- CHANGE CHANGE CHANGE ---
# $ make -j15 chrome
# $ find out/Debug/ -name "*.a" | xargs ls -s > after.txt
# $ diff -u before.txt after.txt | ./count_sizediff.py
@eglaysher
eglaysher / find_heaviest_weak_symbols.py
Created August 26, 2010 18:57
find_heaviest_weak_symbols.py: Find the most included symbols in .o files.
#!/usr/bin/python
#
# Is your C++ project made of bloat and fail? Wouldn't it be great if you got a
# nice table of the individual symbols sorted by total size (size of one
# instance * number of instances)?
#
# Use as such:
#
# $ find <builddir> -name "*.o" | xargs nm -S | c++filt | find_heaviest_weak_symbols.py
@eglaysher
eglaysher / grepsource.el
Created February 1, 2010 23:59
grepsource: Quick grepping when we have git-grep, find|xargs when we don't.
(defconst grepsource-filetypes
'("*.h" "*.hpp" "*.cpp" "*.c" "*.cc" "*.cpp" "*.inl" "*.grd" "*.idl" "*.m"
"*.mm" "*.py" "*.sh" "*.cfg" "*SConscript" "SConscript*" "*.scons"
"*.vcproj" "*.vsprops" "*.make" "*.gyp" "*.gypi")
"A list of filetype patterns that grepsource will use.")
(defun grepsource (cmd-args)
"Grep `default-directory' using git-grep for speed if we're in
a git repository and falling back to a big \"find | xargs grep\"
command if we aren't."