Skip to content

Instantly share code, notes, and snippets.

### Copyright (c) 2015, Sergey Shishmintzev
### License: Apache/GPLv3
### Example video: http://youtu.be/aJ9IRxgpH10
### Interpreter: Python 2.7.5 with NumPy 1.9.1 and Pillow 2.7.0
power = 19
name = "spiral"
frame_count = 15000
### Copyright (c) 2015, Sergey Shishmintzev
### License: Apache/GPLv3
### Examples: http://youtu.be/aSRwEo0MdqM
### Interpreter: Python 2.7.5 with NumPy 1.9.1 and Pillow 2.7.0
power = 19
name = "transit"
frame_count = 511
### Copyright (c) 2015, Sergey Shishmintzev
### License: Apache/GPLv3
### Examples: http://youtu.be/2kckHKCVvDs https://youtu.be/aFN02gJUJ0o
### Interpreter: Python 2.7.5 with NumPy 1.9.1 and Pillow 2.7.0
power = 19
name = "spiral"
frame_count = 12000
@x-or
x-or / ReactIgnore
Last active August 29, 2015 14:12 — forked from alexeisavca/ReactIgnore
var React = require('react/addons');
var ReactIgnore = {
displayName: 'ReactIgnore',
shouldComponentUpdate (){
return false;
},
render (){
return React.Children.only(this.props.children);
}
import numpy as np
from PIL import Image
def digital_reverse(n, length, base):
r = 0
for _ in range(length):
r = base*r + n % base
n /= base
return r
import numpy as np
from PIL import Image
def digital_reverse(n, length, base):
r = 0
for _ in range(length):
r = base*r + n % base
n /= base
return r
@x-or
x-or / images2gif.py
Created July 3, 2014 09:51
reverse_rule15_0_sliding_color
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein, Ant1, Marius van Voorden
#
# This code is subject to the (new) BSD license:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
import numpy as np
from PIL import Image
def digital_reverse(n, length, base):
r = 0
for _ in range(length):
r = base*r + n % base
n /= base
return r
#
# Manifestation of Permuted Diagonal Line generator
#
import numpy as np
from PIL import Image
def digital_reverse(n, length, base):
r = 0
for _ in range(length):
r = base*r + n % base
@x-or
x-or / digital_reverse.py
Created July 2, 2014 08:57
Digital Reverse in Python
def digital_reverse(n, length, base):
r = 0
for _ in xrange(length):
r = base*r + n % base
n /= base
return r
assert digital_reverse(123, 3, 10) == 321
assert digital_reverse(54321, 5, 10) == 12345
assert digital_reverse(0x123, 3, 16) == 0x321