Skip to content

Instantly share code, notes, and snippets.

View teamdandelion's full-sized avatar
💭
they/them

team Dandelion Mané teamdandelion

💭
they/them
View GitHub Profile
@teamdandelion
teamdandelion / PowerSum.hs
Created April 30, 2013 22:19
Prints lists of numbers which are the sum of two powers of a given base
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
@teamdandelion
teamdandelion / composition test
Created May 12, 2013 20:05
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):
@teamdandelion
teamdandelion / species mockup.xml
Created May 16, 2013 07:56
A mockup xml for a pokemon project
<pokemon>
<name>Bulbasaur</name>
<id>001</id>
<catchRate>45</catchRate>
<baseExp>64</baseExp>
<genderRatio>.875</genderRatio>
<experienceGroup>mediumSlow</experienceGroup>
<moves>
<move>
<moveName>Tackle</moveName>
@teamdandelion
teamdandelion / gist:a9c1ac21da2a04ee3c61
Created September 28, 2014 20:16
keybase.io proof
### 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:
@teamdandelion
teamdandelion / data.txt
Created April 3, 2015 00:46
Given you have 1000 people in a room, what is expected # of countries represented?
1369060000
1269140000
320711000
255461700
204105000
189397000
183523000
158093000
146267288
126910000
#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");
<!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 {
<!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 {
@teamdandelion
teamdandelion / multiple-replace.html
Created April 15, 2016 20:55
Attempt to replace more than one element in wct
<!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() {

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: