Skip to content

Instantly share code, notes, and snippets.

@lilgreenland
lilgreenland / index.html
Last active September 11, 2017 02:59
planetesimals (matter.js)
<br>
<div id='level'>
<h1 style="text-align:center">planetesimals</h1>
<div id='planet' onclick="planetesimals()">
<p>click to begin</p>
<br>
<p>move: WASD / arrows</p>
<br>
<p>fire: spacebar</p>
</div>
@mrliptontea
mrliptontea / git-standup
Last active December 11, 2024 14:31
Git Daily Scrum helper
#!/bin/bash
# ------------------------------------------------------------------
# Git Daily Scrum (stand-up meeting) helper.
#
# The script helps you remember what you did last time and facilitates
# writing daily log for remote teams. Be aware that it assumes that
# meetings are conducted at the same time every day.
#
# Installation:
# 1. Place the script in some folder, e.g. your home:
@xvitaly
xvitaly / remove_crw.cmd
Last active July 12, 2025 09:00
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@ericlbarnes
ericlbarnes / app.js
Created July 22, 2015 02:18
Example delete request
$(document).ready(function() {
$("button.remove").on('click', function(e){
e.preventDefault();
if ( ! confirm('Are you sure?')) {
return false;
}
var action = $(this).data("action");
var parent = $(this).parent();
$.ajax({
type: 'delete',
@soufianeEL
soufianeEL / laravel.js
Last active June 18, 2023 05:25 — forked from JeffreyWay/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
Exemples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
*/
(function() {
@staltz
staltz / introrx.md
Last active November 19, 2025 07:55
The introduction to Reactive Programming you've been missing
@timetocode
timetocode / interp-sample.js
Created April 23, 2014 22:43
Entity interpolation
/* Entity Interpolation
this code occurs within the draw loop for an entity
this.x and this.y represent the most recently received server position of
the entity -- though i don't ever intend to use it for drawing
when an update is received (roughly every 50ms in my particular game) this.x and this.y get
pushed into previousState.x and previousState.y
i also continue sloppily onwards to previousPreviousState.x, but I've removed that code
@brunomikoski
brunomikoski / PlayerPrefsX.cs
Created January 30, 2014 22:06
More Versatil PlayerPrefs for Unity3D
// ArrayPrefs2 v 1.3
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
public class PlayerPrefsX
{
static private int endianDiff1;
@timetocode
timetocode / lagCompensation.js
Last active March 15, 2019 03:14
Lag compensation of a player's attack, using a historical stack of quadtrees and "rewinding" relevant entities stored in the quadtrees to the position they were at in the recent past (as decided by the player's ping).There is a SIGNFICANT oddity to this code, which is that quadtrees used for collisions are point quadtrees. Because of this, the i…
// a fat hitbox around the player considered the 'relevant' area for a collision
var hitArea = new AABB({x: player.x, y: player.y}, { x: 54, y : 54})
var actualHitArea = new AABB({x: player.x, y: player.y}, { x: 36, y : 36})
// how behind the player is, in server time
var delay = player.ping + (1000 / player.tickRate)
var tickLength = 1000 / TICKS_PER_SECOND
var ticksAgo = Math.floor(delay / tickLength)
var tickPortion = (delay % tickLength) / tickLength
@ngryman
ngryman / README.md
Last active January 16, 2023 14:07
intellij javascript live templates

intellij javascript live templates

Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.

How to

  • Go to settings.
  • Search for live templates.
  • Under the javascript section you should be able to manage your templates.