Skip to content

Instantly share code, notes, and snippets.

What i wanna do:
- Get all repos from a github organization.
- Save them to the database.
- Get all contributors from the repos that we just stored in the database.
- Create a two way relationship Contributor <-> Project
# Models.py
class Project(TimeStampedModel):
// This is the working sketch
// THIS IS THE WORKING ONE!!
// With ESP8266
#include <OneWire.h>
#include <DallasTemperature.h>
#include <SoftwareSerial.h>
#define ONE_WIRE_BUS 3
#define SSID "network"
@jherrlin
jherrlin / arch-linux-install
Created December 1, 2017 15:05 — forked from binaerbaum/arch-linux-install
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swiss-french keymap
** 2DV505 - Current Topics in Computer Science :school:
Johan is available every Tuesday between 10:00-12:00.
*** Ideas
**** Emacs Lisp
***** Network manager integration
***** Minor mode
***** Unitime integration
***** Something in orgmode
#python3.5
import urllib.request as urllib2
import json
import codecs
#API base url,you can also use https if you need
url = "http://macvendors.co/api/"
#Mac address to lookup vendor from
mac_address = "BC:92:6B:A0:00:01"
@jherrlin
jherrlin / arch-linux-install
Created October 31, 2016 15:59 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
from pprint import pprint as pp # Good looking print
animals = [
{'name': 'Fluffykins', 'species': 'rabbit'},
{'name': 'Caro', 'species': 'dog'},
{'name': 'Hamilton', 'species': 'dog'},
{'name': 'Harold', 'species': 'fish'},
{'name': 'Ursula', 'species': 'cat'},
{'name': 'Jimmy', 'species': 'fish'}
]
def add(a, b):
return a + b
add('hej', 'san') # Ska funka eftersom det är strings.
add(1, 2) # Ska funka eftersom båda är ints.
add('hejsan', 1) # Python är hårt typat, så här får vi type error.
function setup {
echo "Removing test container..."
rm -rf containers
echo "Git clone owtf valhalla containers"
git clone git@github.com:Kodkollektivet/owtf-valhalla-containers.git containers
printf "Creating virtual environment...\n\n"
virtualenv --python=/usr/bin/python venv
import string
first = [i for i in range(7)]
second = ["{}{}".format(a,b) for a in string.ascii_uppercase for b in string.ascii_uppercase]
third = ['{}'.format(i).zfill(3) for i in range(10)]
big_list = []
for a in first: