This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var color = window.getComputedStyle( | |
document.querySelector('.element'), ':before' | |
).getPropertyValue('color') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(()=>{ | |
const o = {arr:[1,2,3], obj:{a:1,b:2,c:3}}; | |
const foo{arr:a,obj:o} = o;//making it easy to transfer data from one object to another | |
console.log(foo);//foo = {a:[1,2,3],o:{a:1,b:2,c:3}} | |
const bar = {baz:"foo",foo:"bar",bar:"baz"}; | |
const poo = Object.assgin({},bar);//this would be okey if it offer filter in it their argument | |
const poo = Object.assgin({},bar,["baz","foo"]); | |
poo//{baz:"foo",foo:"bar"} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Readable; | |
Readable = require("stream").Readable; | |
var readable; | |
readable = new Readable(); | |
var i; | |
i = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; //<= comment out strict mode after running it to see the output. | |
function self(){ | |
console.log(this); | |
} | |
console.log("with gOPN this:" + Object.getOwnPropertyNames(this)); // => [] | |
console.log("just cl this:" + this); // => {} | |
console.log("with gOPN this.__proto__:" + Object.getOwnPropertyNames(this.__proto__)); | |
console.log("just cl this.__proto__:" + this.__proto__); | |
process.stdout.write("function self: "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Use strict"; | |
Buffer.prototype.read = function(index, dataType, offfset, end){ | |
offset = offset||0; | |
end = end||this.length; | |
return (this["read"+dataType](index, offset, end)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8" /> | |
<label class="myItems">Hello</label> | |
<label class="myItems">World!</label> | |
<script src="jqflower.js"></script> | |
<script> | |
try { | |