Skip to content

Instantly share code, notes, and snippets.

View serverhiccups's full-sized avatar
💜
jag håller på att lära mig alla språken!

serverhiccups serverhiccups

💜
jag håller på att lära mig alla språken!
View GitHub Profile
@serverhiccups
serverhiccups / test.html
Created October 10, 2015 19:01
light.js test
DOCTYPE? HTML
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
$("#go").click(function() {
var iframe = $("#ifm");
var url = $('#urlbar').val();
$("iframe").attr("src", url);
</head>
@serverhiccups
serverhiccups / playnotes.ino
Created November 2, 2015 06:30
A test piece of code
int incomingByte = 0; // for incoming serial data
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
int tonePin = 9;
}
void loop() {
@serverhiccups
serverhiccups / test.js
Last active November 6, 2015 04:50
My current phosphate code
$(document).ready(function(){
var scratch_player = $(".stage");
var url = window.location.href;
url = url.substr(33,40);
$(scratch_player).empty();
$(scratch_player).append("<script src='https://phosphorus.github.io/embed.js?id=", url, "&auto-start=false&light-content=false'></script>");
});
@serverhiccups
serverhiccups / poem.md
Last active December 6, 2015 07:08
A poem for school.

A eventful garden

Roses are red, Voilets are red, Trees are red, Your garden's on fire.

By hiccup01

@serverhiccups
serverhiccups / macosxinstall.sh
Last active January 4, 2016 23:17
A kea installer for Mac OSX.
#!/bin/bash
#This is a shell script created by hiccup01 to install kea on Mac OSX.
VERSION="0.0.1" #Installer version
BVERSION="0.2.2" #Browser version
echo "Thanks for installing kea"
echo "You are running Mac OSX kea installer version $VERSION for kea version $BVERSION."
echo "This installer was created by hiccup01 (hiccup01.com)"
sleep 1
echo "At some points you may be prompted to enter your password. Type it and press \"enter\". (It will not display your password on screen)"
sleep 3
@serverhiccups
serverhiccups / advancedtopics.user.js
Last active February 21, 2016 02:17
Change discuss link on scratch to advanced topics (Now replaces the explore button instead)
// ==UserScript==
// @name Advanced Topics Linker
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Replace explore with Advanced Topics link
// @author Dylan5797 (and hiccup01)
// @match https://scratch.mit.edu/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@serverhiccups
serverhiccups / swiki.js
Last active March 25, 2016 00:08
A js program to search the scratch wiki.
var searchterm = encodeURI(prompt("Enter your search term"));
if searchterm = null {
console.log("Error: null is invalid input.")
} else {
var url = "http://wiki.scratch.mit.edu/w/index.php?title=Special%3ASearch&profile=default&search=" + searchterm + "&fulltext=Search";
window.open(url);
}
var PNGImage = require('pngjs-image');
var pad = require('pad-left');
var request = require('request');
function getColoursFromUUID(code, topad, callback) {
var colours = []; // Array of colours
PNGImage.readImage(('https://crafatar.com/avatars/' + code + '?size=8'), // Url to get heads
function(err, image) {
if (err) throw err;
var colour; // Variable colour is stored in on retreival from image
for (var i = 0; i < image.getHeight(); i++) { // For every line of pixels (height)
@serverhiccups
serverhiccups / installNodeOnDPLY.sh
Created November 26, 2016 01:00
Install node on my button
if [ ! -f /installed.txt ]; then
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
apt-get install -y nodejs npm
npm install -g scratchapi
cd /root
npm init -y
touch /installed.txt
fi
@serverhiccups
serverhiccups / hiccups.terminal
Last active December 4, 2016 05:39
My Terminal.app config
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundBlur</key>
<real>0.092837791997573277</real>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OV05TV2hpdGVcTlNDb2xvclNwYWNlViRjbGFzc00w