Skip to content

Instantly share code, notes, and snippets.

View martinnormark's full-sized avatar
:shipit:
Always Be Shipping

Martin Høst Normark martinnormark

:shipit:
Always Be Shipping
View GitHub Profile
var NUM_PARTICLES = ( ( ROWS = 100 ) * ( COLS = 300 ) ),
THICKNESS = Math.pow( 80, 2 ),
SPACING = 8,
MARGIN = 100,
DRAG = 0.95,
EASE = 0.25,
PARTICLE_SIZE = 5, // Size of each particle
PARTICLE_COLOR = {r: 0, g: 255, b: 0, a: 1}, // Color of each particle
DRAG = 0.95,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Tilt</title>
</head>
<body style="padding: 50px">
<div class="js-tilt" style="width: 300px; height: 300px; background-color: burlywood; display: flex; justify-content: center; align-items: center; overflow: hidden">
<img
src="https://images.unsplash.com/photo-1632993952737-0c2897164db3?ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwyfHx8ZW58MHx8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
using System;
using System.Windows;
using System.Windows.Threading;
namespace WpfApp1
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
@martinnormark
martinnormark / pr-cli-merge.ps1
Created May 7, 2021 06:27
Quickly merge multiple Pull Requests from PowerShell.
$prs = gh pr list | Select-String -Pattern "\d\d\d" | Select-object -last 10
([regex]"\d\d\d").matches($prs) | % { gh pr merge $_.value -m -d }
@martinnormark
martinnormark / aci-create.md
Last active May 16, 2020 09:55
Create Azure Container Instance with SSH support.

Creating the container

environemnt vars to set:
NAME = Martin
SSHUSER = martin
SSHPWD = pwdnitram

command to run: [ "/bin/bash", "-c", "echo hello $NAME; tail -f /dev/null" ]

Configure SSH

Add a user

@martinnormark
martinnormark / .gitignore
Created August 13, 2017 22:28 — forked from FullStackForger/.gitignore
.gitignore for Unity3d project
###
# Unity folders and files
###
[Aa]ssets/AssetStoreTools*
[Bb]uild/
[Ll]ibrary/
[Ll]ocal[Cc]ache/
[Oo]bj/
[Tt]emp/
[Uu]nityGenerated/
@martinnormark
martinnormark / The Technical Interview Cheat Sheet.md
Created July 11, 2016 08:52 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@martinnormark
martinnormark / D3 step after
Last active April 28, 2016 13:03 — forked from mbostock/.block
Line Chart
license: gpl-3.0
@martinnormark
martinnormark / hapijs-routes.js
Created March 26, 2016 06:23
Load routes from separate files with hapi.js
module.exports = [
{ method: 'GET', path: '/users', handler: function () {} },
{ method: 'GET', path: '/users/{id}', handler: function () {} }
];
---
var cart = require('./cart');
var user = require('./user');
@martinnormark
martinnormark / d3-mouse-over-line.js
Created March 22, 2016 11:53
Adding a vertical line to a D3 chart, that follows the mouse pointer.
var vertical = d3.select(".chart")
.append("div")
.attr("class", "remove")
.style("position", "absolute")
.style("z-index", "19")
.style("width", "1px")
.style("height", "380px")
.style("top", "10px")
.style("bottom", "30px")
.style("left", "0px")