This file contains 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 patch (current, next) { | |
if (current.isEqualNode(next)) { | |
return | |
} | |
if (current.nodeName !== next.nodeName) { | |
current.parentNode.replaceChild(current, next) | |
return | |
} | |
if (current.nodeType === 3) { | |
if (current.data !== next.data) { |
This file contains 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
.range { | |
position: relative; | |
height: 24px; | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
cursor: default; | |
user-select: none; | |
} | |
.range:before { |
This file contains 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
<?php | |
$file = 'path-to-file'; | |
$size = filesize($file); | |
$start = 0; | |
$end = $size - 1; | |
if (preg_match('/bytes=(\d+)-(\d*)/i', $_SERVER['HTTP_RANGE'] ?? '', $matches)) { | |
$start = $matches[1]; | |
if (!empty($matches[2])) { | |
$end = $matches[2]; | |
} |
This file contains 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
#include <windows.h> | |
void main() { | |
SendMessage(0xFFFF, 0x112, 0xF170, 2); | |
} |
This file contains 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
@echo off | |
tcc echo_server.c | |
tcc echo_client.c |
This file contains 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 neighbors = [ | |
[ 0, 1, 0], | |
[ 1, 0, 0], | |
[ 0, -1, 0], | |
[-1, 0, 0], | |
[ 0, 0, 1], | |
[ 0, 0, -1] | |
] | |
var cornerTopLeftFront = [-0.5, 0.5, 0.5] |
This file contains 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
let { Window } = require('./happy-dom') | |
let window = new Window() | |
let document = window.document | |
test( | |
'No change', | |
['A', 'B', 'C', 'D'], | |
['A', 'B', 'C', 'D'] | |
) |
This file contains 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
[ | |
{ | |
"id": "1", | |
"title": "Post A", | |
"category": { | |
"id": "1", | |
"name": "Category A" | |
}, | |
"comments": [ | |
{ |
This file contains 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
port = 3000 | |
express = require 'express' | |
serveStatic = require 'serve-static' | |
serveIndex = require 'serve-index' | |
router = require './router' | |
express() | |
.use router | |
.use serveStatic('.') | |
.use serveIndex('.') |
This file contains 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
<?php | |
function kvstore ($file, $init = NULL) { | |
static $stores = []; | |
$store = @$stores[$file]; | |
if (!$store) { | |
$prev = @file_get_contents($file); | |
if (!$prev) { | |
if ($init) { | |
$prev = json_encode((object) $init()); |
NewerOlder