Skip to content

Instantly share code, notes, and snippets.

@L2L2L
L2L2L / UDPSocket.cs
Created May 20, 2019 23:52 — forked from darkguy2008/UDPSocket.cs
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 / gist:ca4b3693cc13bfad1c1aa2bffbf1864f
Created July 23, 2018 13:57 — forked from podo/gist:5361182
Get Pseudo-Element Properties with JavaScript
var color = window.getComputedStyle(
document.querySelector('.element'), ':before'
).getPropertyValue('color')
@L2L2L
L2L2L / README
Last active January 26, 2018 19:54 — forked from joelambert/README
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
function JSON_stringify(s, emit_unicode)
{
var json = JSON.stringify(s);
return emit_unicode ? json : json.replace(/[\u007f-\uffff]/g,
function(c) {
return '\\u'+('0000'+c.charCodeAt(0).toString(16)).slice(-4);
}
);
}
@L2L2L
L2L2L / svg2png.js
Last active August 29, 2015 14:11 — forked from gustavohenke/svg2png.js
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() {
<!DOCTYPE html>
<meta charset="utf-8" />
<label class="myItems">Hello</label>
<label class="myItems">World!</label>
<script src="jqflower.js"></script>
<script>
try {