Skip to content

Instantly share code, notes, and snippets.

View krono's full-sized avatar

Tobias Pape krono

View GitHub Profile
from pypy.rlib.parsing.tree import Node as PyNode
from pypy.rlib.parsing.lexer import SourcePos
class Node(PyNode):
def __init__(self, source_position=None):
self.source_position = source_position or SourcePos(-1,-1,-1)
def __eq__(self, other): pass #...
@krono
krono / fix-brew-outdated-gettext.sh
Created March 31, 2013 17:04
Gettext via brew was updated and the old one cleaned, yet, some libs still directly linked to the old gettext directly. This gist fixes this problems by reinstalling all affected packages.
#!/bin/bash
pushd /usr/local/lib
for package in $(
for i in *.dylib; do
if otool -L $i | grep -q gettext/0.18.1.1; then
# get pacakge out ouf library
echo $(basename $(dirname $(dirname $(dirname $(readlink $i)))));
fi;
@krono
krono / dotify-package-deps.st
Last active December 20, 2015 07:18 — forked from frankshearar/dotify-package-deps.st
Make a dot/graphviz-file from the package-dependencies in Squeak
| allDeps toDigraph |
"Avoid artifacts"
MCWorkingCopy flushObsoletePackageInfos.
PackageOrganizer default flushObsoletePackages: [:p |
p classes size = 0 and: [p methods size = 0]].
Smalltalk garbageCollect.
""
toDigraph := [:hash | | s |
s := WriteStream on: String new.
s nextPutAll: 'digraph {'; lf.
#include <stdio.h>
void foo(void) {
static int barf=10;
barf++;
}
int main()
{
printf("test: %d\n", (int)foo());
@krono
krono / 256color.diff
Created February 8, 2014 21:31
rpython fractal for 265 colors
diff -r 61a9f16c3e8b rpython/tool/ansi_mandelbrot.py
--- a/rpython/tool/ansi_mandelbrot.py Sat Feb 08 11:35:59 2014 +0100
+++ b/rpython/tool/ansi_mandelbrot.py Sat Feb 08 22:29:41 2014 +0100
@@ -14,8 +14,12 @@
"""
-palette = [39, 34, 35, 36, 31, 33, 32, 37]
-
+import os
@krono
krono / clang.s
Last active August 29, 2015 13:56
get-int8-out-int32
.section __TEXT,__text,regular,pure_instructions
.globl _f
.align 4, 0x90
_f: ## @f
.cfi_startproc
## BB#0:
pushq %rbp
Ltmp2:
.cfi_def_cfa_offset 16
Ltmp3:
@krono
krono / clang.s
Last active August 29, 2015 13:56
decompiled-clang
#clang.dylib:
#(__TEXT,__text) section
_f:
0000000000000f90 pushq %rbp
0000000000000f91 movq %rsp, %rbp
0000000000000f94 movl %edi, %eax
0000000000000f96 popq %rbp
0000000000000f97 ret
#
# Automatically generated file; DO NOT EDIT.
# Freetz Configuration
#
FREETZ_HAVE_DOT_CONFIG=y
#
# User competence ------------------------
#
# FREETZ_USER_LEVEL_BEGINNER is not set
(Array streamContents: [:s |
(1 to: 998) do: [:x |
(1 to: 998) do: [ :y |
(1 to: 998) do: [:z |
((x+y+z) = 1000 and: [(x * x)+ (y*y) = (z*z)])
ifTrue: [s nextPut: {x.y.z}]]]]])
collect: [:a | [:x :y :z | x * y * z] valueWithArguments: a]

Keybase proof

I hereby claim:

  • I am krono on github.
  • I am krono (https://keybase.io/krono) on keybase.
  • I have a public key whose fingerprint is 5F8E 6A65 A617 6A07 B60A 8331 1957 A66A 08B5 F61C

To claim this, I am signing this object: