Skip to content

Instantly share code, notes, and snippets.

View larsemil's full-sized avatar
🏅
plain awesome

Emil Österlund larsemil

🏅
plain awesome
View GitHub Profile
# Konfiguration
$OWNER = "2047-Science-Center"
$REPO = ""
$FILE_PATH = [System.Environment]::GetFolderPath("MyDocuments") # Använder användarens Dokument-mapp
$TOKEN = "" # Ersätt med din faktiska GitHub token
$VERSION_FILE = Join-Path $FILE_PATH "latestVersion.txt"
$API_URL = "https://api.github.com/repos/$OWNER/$REPO"
# Hämta den senaste releasen med Invoke-RestMethod
$headers = @{
@larsemil
larsemil / intersects.js
Created March 17, 2021 08:22
Javascript rectangle intersect function
/**
* Check if two objects intersect
*
* Objects need to have x,y,width,height properties
*
* @param {object} obj1 - The first object.
* @param {object} obj2 - The second object.
* @returns {boolean} true if objects intersect
*/
function intersects(obj1, obj2) {
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@larsemil
larsemil / file_handler.py
Last active September 29, 2017 12:01
pip install dmenu
#!/usr/bin/python
from dmenu import dmenu
import sys
import os
browser = 'xdg-open %s'
choices = {
'Open in thunar' : 'thunar %s',
'Open in firefox':'firefox %s',
}

Keybase proof

I hereby claim:

  • I am larsemil on github.
  • I am larsemil (https://keybase.io/larsemil) on keybase.
  • I have a public key whose fingerprint is CE37 64D3 7ED8 D971 57DE 8761 B283 38D5 4C7E 45B2

To claim this, I am signing this object:

@larsemil
larsemil / makeFolders.py
Created April 19, 2013 12:01
Small script to create folders when need arise
#!/usr/bin/python
import sys
import os
print sys.argv
if len(sys.argv) < 4:
print "You have to specify atleast three integers: makefolder.py x y z, where x is how many folders, y is how many folders deep and z how many files created in each folder"
def makeFolders(quantity,depth,path = './'):
@larsemil
larsemil / ddevents.js
Created October 10, 2012 11:24
ddeventz frontend
var theFeed = 0;
var pointer = -1;
$(document).ready(function()
{
$.getJSON('http://events.daladevelop.se/index.php?callback=?&eventId=1', function(data) {
theFeed = data;
interval = window.setInterval("swapFeed()", 4000);
});