Skip to content

Instantly share code, notes, and snippets.

View fourohfour's full-sized avatar

FourOhFour fourohfour

View GitHub Profile
/*PSA*/
.side .md h4:nth-of-type(1) {
list-style-type:none!important;
position: absolute;
font-size: 14px;
display: block;
top: 70px; /*Change this in relation to your header's height*/
left: 5px; /*adjust this is well*/
margin:0;
background-color: #f6f7f8!important; /*Change for different background color*/
import urllib.request
def getDimensions(url, data):
req = urllib.request.Request(url)
page = urllib.request.urlopen(req)
pstr = page.read()
psplit = str(pstr).split("Dimensions")
info = ""
for char in psplit[1]:
info = info + char
set *{ # State of Stack: arg1, arg2, exit
call +
return 1
} -> thing
set 3 -> x
set 5 -> y
call thing x y
import urllib.request
for i in range(10):
while True:
req = urllib.request.Request("http://fr.wiktionary.org/wiki/Sp%C3%A9cial:Page_au_hasard")
page = urllib.request.urlopen(req)
page = str(page.read())
psplit = page.split('<h1 id="firstHeading" class="firstHeading" lang="fr">', 1)
title = psplit[1].split("</h1>", 1)[0]
@fourohfour
fourohfour / gist:8243942
Created January 3, 2014 18:49
Get killer
Player killer = event.getEntity().getKiller();
if (!(killer == null)){
killer.addHealth(2) //or whatever
}
// ==UserScript==
// @name PeaceAndQuiet
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Speak freely in robin chats.
// @author DC-3
// @match https://www.reddit.com/robin
// @grant none
// ==/UserScript==

#MAC and IP Addresses, and the OSI Model

One of the most advanced concepts in the GCSE Computing course is IP and MAC Addresses; specifically the differences between them and their differing usages. To understand them, it is helpful to learn about the OSI Model of Computer Networking; although this is an A-Level concept it forms the foundations for an understanding of what IP and MAC Addresses are and what they do.

Computer Networks are managed by a series of Protocols. A Protocol can best be thought of as a sort of rulebook. A football team from Brazil can play one from China - although they are geographically distant, they are both following the same Protocol, as such. Here are some of the more well known protocols:

Layer 5

HTTP (HyperText Transfer Protocol, for webpages)

FTP (File Transfer Protocol, for files)

Blancpain GT - Race for the Championship

The Protagonists

Championship contendors prior to the race.

@fourohfour
fourohfour / currency.py
Last active November 6, 2016 06:19
Currency Convertor
from urllib.request import urlopen, build_opener
import html
## User Interface Layer
class InputtedValue:
def __init__(self, code, quantity = 1.0):
self.code = code
self.quantity = quantity
@fourohfour
fourohfour / vw_full_code
Created January 4, 2017 18:14
Main Robot Code for VEX Team 3117
// This code requires the vanwall library to function
#include "vanwall.c"
// =*=*= Main Robot Code for VEX Team 3117 =*=*=
// *= Release: 04/01/17 =*
// This file is composed of the following sections:
// - Allocation : Creating data structures in memory
// - Creation : Initialising data structures
// * Assigning ports to motors