Skip to content

Instantly share code, notes, and snippets.

View snorpey's full-sized avatar

georg fischer snorpey

View GitHub Profile
@snorpey
snorpey / protect_folder.php
Created December 6, 2018 09:46
gernerate htpasswd and htaccess
<?php
// this script generates a .htaccess and .htpasswd files in a folder (if they don't already exist)
// just upload protect_folder.php and open it the browser.
$user = 'myuser';
$password = 'mypasswort';
$encrypted_password = crypt( $password, base64_encode( $password ) );
$folder_path = dirname( __FILE__ );
@rem *** Disable Some Service ***
sc stop DiagTrack
sc stop diagnosticshub.standardcollector.service
sc stop dmwappushservice
sc stop WMPNetworkSvc
sc stop WSearch
sc config DiagTrack start= disabled
sc config diagnosticshub.standardcollector.service start= disabled
sc config dmwappushservice start= disabled
@snorpey
snorpey / 01-readme.md
Created August 27, 2016 13:26
image fetch and parse in webworker

this is a little demo on how to load images in a non-blocking way using webworker

what this program does:

  1. it loads a png image in a web worker, using the fetch() api.
  2. it parses the data using the png.js library
  3. it passes the png data to the main thread using postMessage()
  4. it draws the contents of the image on a canvas element

the important part for me was the fact that i can get the pixel data of the png without blocking the main thread…

@snorpey
snorpey / index.html
Last active December 5, 2015 21:10
localforage error in worker in safari
<!doctype html>
<script>
var worker = new Worker( 'localforageworker.js' );
</script>
@snorpey
snorpey / 00_readme.md
Last active September 27, 2015 10:35
B5 am Feiertag Downloader
@snorpey
snorpey / admin.html
Created February 12, 2015 23:05
Spacebrew Disconnect Test
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Admin</title>
<style>body{font-family:sans-serif;padding:50px;}.is-connected{background-color:green}</style>
</head>
<body>
<h1>ADMIN</h1>
<script src="spacebrew-1.4.1.js"></script>
@snorpey
snorpey / circle rotated rectangle collision.js
Last active March 1, 2024 13:43
Calculate collision between circle and rotated rectangle
// Ported to JavaScript from
// http://www.migapro.com/circle-and-rotated-rectangle-collision-detection/
//
// An example:
// var circle: { x: 20, y: 10, radius: 20 };
// var rect: { x: 30, y: 30, width: 100, height: 100, rotation: Math.PI / 2 };
// collideCircleWithRotatedRectangle( circle, rect );
// // returns true.
//
//
@snorpey
snorpey / css-easing-functions.js
Created May 8, 2014 09:20
An AMD module with CSS easing functions
/*global define*/
define(
function ()
{
return {
linear: 'linear',
ease: 'ease',
easeIn: 'ease-in',
easeOut: 'ease-out',
easeInOut: 'ease-in-out',
@snorpey
snorpey / easing.css
Created May 8, 2014 09:15
A collection of CSS easing functions
.easing-linear {
transition-timing-function: linear;
}
.easing-ease {
transition-timing-function: ease;
}
.easing-easeIn {
transition-timing-function: ease-in;
@snorpey
snorpey / load-image.js
Created April 23, 2014 08:06
AMD module that loads an image. Caches images.
/*global define*/
/*
AMD module that loads an image. Caches images.
Note: this code has not been tested extensively. Use with caution.
MIT License
*/
define(
function ()
{
var images = { };