Skip to content

Instantly share code, notes, and snippets.

💭
they/them

Dandelion Mané decentralion

💭
they/them
Block or report user

Report or block decentralion

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@decentralion
decentralion / PowerSum.hs
Created Apr 30, 2013
Prints lists of numbers which are the sum of two powers of a given base
View PowerSum.hs
isPowerSum :: Int -> Int -> Bool
isPowerSum p x= any (==x) [a + b | a <- shortPows, b <- shortPows] where
shortPows = takeWhile (<x) . map (p^) $ [0..]
powerSequence :: Int -> [Int]
powerSequence p = filter (isPowerSum p) [1..]
sq1 = take 20 . powerSequence $ 2
sq2 = take 20 . powerSequence $ 3
sq3 = take 20 . powerSequence $ 5
View composition test
# posted as a comment to this stackoverflow question:
# http://stackoverflow.com/questions/16502315/python-how-to-change-a-module-implementation/16502490#16502490
# when the SpottedDog constructor is called, results in infinite recursion
class Dog(object):
"""docstring for Dog"""
def __init__(self, name):
self.name = name
def growl(self):
@decentralion
decentralion / species mockup.xml
Created May 16, 2013
A mockup xml for a pokemon project
View species mockup.xml
<pokemon>
<name>Bulbasaur</name>
<id>001</id>
<catchRate>45</catchRate>
<baseExp>64</baseExp>
<genderRatio>.875</genderRatio>
<experienceGroup>mediumSlow</experienceGroup>
<moves>
<move>
<moveName>Tackle</moveName>
View gist:a9c1ac21da2a04ee3c61
### Keybase proof
I hereby claim:
* I am danmane on github.
* I am danmane (https://keybase.io/danmane) on keybase.
* I have a public key whose fingerprint is 523A A2C9 3FD8 525D 85EF F1BB AE66 0A89 4100 BADB
To claim this, I am signing this object:
@decentralion
decentralion / data.txt
Created Apr 3, 2015
Given you have 1000 people in a room, what is expected # of countries represented?
View data.txt
1369060000
1269140000
320711000
255461700
204105000
189397000
183523000
158093000
146267288
126910000
View gist:a6559bf5fcaae4b2ba32
#define BUFFER_SIZE 4
struct message {
int content;
};
struct message buffer[BUFFER_SIZE];
int main() {
int i;
printf("allocated buffer, have done nothing with it");
View demo.html
<!DOCTYPE html>
<html>
<head>
<script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="pk-string-input-array.html">
</head>
<body>
<style>
#demo {
View demo.html
<!DOCTYPE html>
<html>
<head>
<script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="pk-string-input-array.html">
</head>
<body>
<style>
#demo {
@decentralion
decentralion / multiple-replace.html
Created Apr 15, 2016
Attempt to replace more than one element in wct
View multiple-replace.html
<!DOCTYPE html>
<html>
<head>
<link rel="import" href="../../polymer/polymer.html">
<script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../web-component-tester/browser.js"></script>
</head>
<body>
<script>
window.HTMLImports.whenReady(function() {
View keybase.md

Keybase proof

I hereby claim:

  • I am danmane on github.
  • I am dandelion (https://keybase.io/dandelion) on keybase.
  • I have a public key whose fingerprint is CC0B 6DD9 3B6B 2BF0 4073 F9AF 2FCE 257A 3576 5526

To claim this, I am signing this object:

You can’t perform that action at this time.