This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
NewerOlder