Skip to content

Instantly share code, notes, and snippets.

@iankronquist
iankronquist / README.md
Last active August 29, 2015 14:03
Mozilla Input User Happitude data

This page uses data from the input.mozilla.org API to display what users think of Mozilla's products.
Keep in mind that most people aren't motivated to give feedback unless they have a problem.
Green circles represent users who submitted positive feedback.
Red circles represent users who submitted negative feedback.

import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0,10,1000)
x = 3.9 * (np.sin(t)**3)
y = -1 + (3 * np.cos(t)) - (1.2 * np.cos(2*t)) - (0.6 * np.cos(3*t)) - (0.2 * np.cos(4 * t))
plt.plot(x, y, 'r')
plt.axis('equal')
plt.fill_between(x,y, color='red')
plt.show()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Ian Kronquist'
__email__ = 'iankronquist@gmail.com'
__version__ = '0.1.0'
How to use pip and virtualenv
---------------------------------
virtualenv is a program for managing python dependencies. If you have virtualenv installed you can manage use different versions of libraries and python with ease.
Install virtualenv at the system level with one of these:
```shell
$ brew install pyenv-virtualenv #osx w/homebrew
$ sudo pacman -S python2-virtualenv #arch linux
$ sudo apt-get install python-virtualenv #ubuntu
```
@iankronquist
iankronquist / classes.py
Last active August 29, 2015 14:20
A quick introdution to Python classes
# This is the new style way of declaring classes and should be preferred
# Python screwed up the way classes and typing works the first go round,
# but they fixed it with new style classes
class Object(object):
# This is the constructor. It takes an instance of the object and a single argument called foo.
def __init__(self, foo):
# Make foo a property of this instance
self.foo = foo
# Add n to foo. Note that if foo is a string, n must also be a string,
# or if foo is a numeric type, foo must also be numeric
@iankronquist
iankronquist / jiralink.py
Last active August 29, 2015 14:26
add links from jira to github
vagrant@debian-8-jessie-puppet:~$ puppet agent -t --server=192.168.33.10
Info: Creating a new SSL key for debian-8-jessie-puppet.vagrantup.com
Info: Caching certificate for debian-8-jessie-puppet.vagrantup.com
Error: Could not request certificate: The certificate retrieved from the master does not match the agent's private key.
Certificate fingerprint: 44:4D:D3:60:37:E1:1C:3A:91:0F:CB:DD:9B:3B:F8:3A:38:00:A4:3B:56:88:13:D4:E0:F5:77:E7:5F:FF:0D:CD
To fix this, remove the certificate from both the master and the agent and then start a puppet run, which will automatically regenerate a certficate.
On the master:
puppet cert clean debian-8-jessie-puppet.vagrantup.com
On the agent:
1a. On most platforms: find /home/vagrant/.puppet/ssl -name debian-8-jessie-puppet.vagrantup.com.pem -delete
@iankronquist
iankronquist / contributing to other peoples projects.md
Last active August 29, 2015 14:27
Contributing to Other People's Open Source Projects

Contributing to Other People's Projects

Contributing to open source software is a difficult and rewarding process. Contrary to popular belief, it does not require a lot of programming skill, but rather patience, creativity, and diligence. In this post I will explain some crucial steps and skills which even experienced contributors sometimes forget. This is not a magic formula, and contributions will require focus and work, but in the end I believe the feeling that you are part of a community and that you have contributed to something greater than yourself is personally fulfilling.

@iankronquist
iankronquist / notes on lxc.md
Last active August 29, 2015 14:27
notes on lxc

Install lxc:

$ sudo yum install lxc lxc-templates lxc-extras

Build container:

$ sudo lxc-create -n test -t fedora

http://ottomancuisine.com/2012/05/24/icli-kofte/

Ingredients:

  • 3 cups of fine grind bulgur (parboiled cracked wheat, you can find it in the organic food section of your supermarket or at Middle Eastern grocery shops) 500g of lean minced beef or lamb (ask your butcher to double grind it, it’s crucial)

  • 2 onions, finely grated

  • 1 whole egg