Skip to content

Instantly share code, notes, and snippets.

@deejaygraham
deejaygraham / eddystone_beacon.cpp
Created August 31, 2017 10:22
microbit eddystone beacon example
#include "MicroBit.h"
MicroBit micro_bit;
int main()
{
micro_bit.init();
micro_bit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_BUTTON_EVT_CLICK, button_a);
micro_bit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, button_b);
@deejaygraham
deejaygraham / day2.html
Created August 16, 2017 12:38
webslides presentation using collection content
---
layout: webslides
title: Microbits and Python
---
{% for post in site.microbits %}
<section>
{{ post.content }}
</section>
{% endfor %}
@deejaygraham
deejaygraham / webslides.html
Created August 16, 2017 12:37
webslides.tv layout for github pages
<!doctype html>
<html lang="en" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Makers and Creators</title>
<meta name="description" content="slides for makers and creators week">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,700,700i%7CMaitree:200,300,400,600,700&amp;subset=latin-ext" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="all" href="../assets/css/base.css">
@deejaygraham
deejaygraham / config.yml
Created August 16, 2017 12:36
jekyll collections yml
collections:
- intro
- microbits
- minecraft
- robots
- projects
@deejaygraham
deejaygraham / move-block.py
Created August 15, 2017 16:56
move blocks
import pygame
pygame.init()
game_width = 640
game_height = 480
screen = pygame.display.set_mode((game_width, game_height)) # size must be (tuple)
pygame.display.set_caption('hello pygame')
@deejaygraham
deejaygraham / toggle-block.py
Created August 15, 2017 16:44
toggle block colour
import pygame
pygame.init()
game_width = 640
game_height = 480
screen = pygame.display.set_mode((game_width, game_height)) # size must be (tuple)
pygame.display.set_caption('hello pygame')
@deejaygraham
deejaygraham / blue-block.py
Last active August 15, 2017 16:36
pygame showing a blue block
import pygame
pygame.init()
game_width = 640
game_height = 480
screen = pygame.display.set_mode((game_width, game_height)) # size must be (tuple)
pygame.display.set_caption('hello pygame')
@deejaygraham
deejaygraham / hello-pygame.py
Created August 15, 2017 16:10
simples pygame skeleton
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480)) # size must be a (tuple)
pygame.display.set_caption('hello pygame')
done = False
while not done:
@deejaygraham
deejaygraham / CreateIISWebsite.ps1
Created May 16, 2017 12:47
Create a very basic, static website in IIS
Import-Module WebAdministration
[string]$IISAppPoolName = "my-lovely-site"
[string]$IISAppPoolDotNetVersion = "v4.0"
[string]$IISAppName = "MyLovelySite"
[int]$Port = 3000
[string]$ScriptFile = $MyInvocation.MyCommand.Path
[string]$ScriptFolder = Split-Path $ScriptFile -Parent