Skip to content

Instantly share code, notes, and snippets.

@oliveratgithub
oliveratgithub / emojis.json
Last active June 1, 2024 08:32
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z
@christopher4lis
christopher4lis / util-elastic-collision.js
Last active June 1, 2024 10:43
A set of utility functions used to reproduce the effect of elastic collision within HTML5 canvas. Used in the Chris Courses tutorial video on collision detection: https://www.youtube.com/watch?v=789weryntzM
/**
* Rotates coordinate system for velocities
*
* Takes velocities and alters them as if the coordinate system they're on was rotated
*
* @param Object | velocity | The velocity of an individual particle
* @param Float | angle | The angle of collision between two objects in radians
* @return Object | The altered x and y velocities after the coordinate system has been rotated
*/
@darkguy2008
darkguy2008 / UDPSocket.cs
Last active May 20, 2024 19:01
Simple C# UDP server/client in 56 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@L2L2L
L2L2L / Buffer's instance method read and write
Last active August 29, 2015 14:05
Replacement for all write and read method for Buffer's instance objects.
"Use strict";
Buffer.prototype.read = function(index, dataType, offfset, end){
offset = offset||0;
end = end||this.length;
return (this["read"+dataType](index, offset, end));
@AndreasMadsen
AndreasMadsen / README.md
Last active July 23, 2021 14:35
Escape-from-xp

From twitter I was told of escape-from-xp ( https://twitter.com/sylwia_erhardt/status/489554167120527360 ). Obiusly I had to hack this an discovered that the code ( https://escapefromxp.azurewebsites.net/game.min.js ) besides not being very compressed, also contained easter eggs for any JavaScript enthusiast. This is how you enable them all:

  1. Go to: https://escapefromxp.azurewebsites.net/#arcade . https://www.modern.ie/en-us/virtualization-tools#escape-from-xp just contain an iframe to this location and #arcade makes sure no redict back to www.modern.ie occurre. #arcade also enables a few other things, you will notice the text have changed a little. Also you now change weapon on F.

  2. Open the JavaScript console in your browser and type:

event = { source: { postMessage: function () {}} };
["hardcoreMode", "originalHacker", "tanksTanksTanks", "IDDQD"].forEach(
  window.ig.game.installServicePack.bind(window.ig.game)
)
@brettz9
brettz9 / jqflower-test.html
Created July 14, 2014 22:04
Non-functioning scribbles for XQuery-like approach in JS
<!DOCTYPE html>
<meta charset="utf-8" />
<label class="myItems">Hello</label>
<label class="myItems">World!</label>
<script src="jqflower.js"></script>
<script>
try {
@gustavohenke
gustavohenke / svg2png.js
Created February 18, 2014 15:27
SVG to PNG
var svg = document.querySelector( "svg" );
var svgData = new XMLSerializer().serializeToString( svg );
var canvas = document.createElement( "canvas" );
var ctx = canvas.getContext( "2d" );
var img = document.createElement( "img" );
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) );
img.onload = function() {
@podo
podo / gist:5361182
Created April 11, 2013 06:27
Get Pseudo-Element Properties with JavaScript
var color = window.getComputedStyle(
document.querySelector('.element'), ':before'
).getPropertyValue('color')
@electricg
electricg / LICENSE-MIT
Last active March 27, 2024 20:59
Stopwatch in javascript
Copyright (c) 2010-2015 Giulia Alfonsi <electric.g@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
@demonixis
demonixis / MathHelper.js
Created December 4, 2012 10:38
JavaScript Math helper
var MathHelper = {
// Get a value between two values
clamp: function (value, min, max) {
if (value < min) {
return min;
}
else if (value > max) {
return max;
}