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
CREATE OR REPLACE FUNCTION table_update_notify() RETURNS trigger AS $$ | |
DECLARE | |
id bigint; | |
BEGIN | |
IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN | |
id = NEW.id; | |
ELSE | |
id = OLD.id; | |
END IF; | |
PERFORM pg_notify('table_update', json_build_object('table', TG_TABLE_NAME, 'id', id, 'type', TG_OP)::text); |
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
#!/bin/bash | |
# Usage: issues [label/p0-2] [limit] [pool_size] | |
# requires gh (github cli) | |
POOL_SIZE=${3:-50} | |
LIMIT=${2:-5} | |
LABEL=${1:-"Needs Triage"} | |
REPO="https://github.com/npm/cli" | |
if [[ $LABEL = "triage" ]]; | |
then |
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
//whenever uncached images are added to the dom tree within target, | |
//replace them with a spinner gif until they're loaded | |
function replaceImages(target, spinner_src) { | |
var spinner, observer; | |
//detect support | |
if (window.MutationObserver) { | |
//preload spinner (probably a gif) | |
//if it's not ready for first use, oh well | |
spinner = new Image(); |
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
--EVAL 'this script' 1 some-key | |
local key = KEYS[1]; | |
local value = redis.call('GET', key); | |
local jvalue = cjson.encode(cmsgpack.unpack(value)); | |
return jvalue; |
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
SELECT json_build_object( | |
'total', (SELECT n_live_tup FROM pg_stat_user_tables WHERE relname='sometable'), | |
'count', count(sometable_rows.*), | |
'offset', 0, | |
'results', json_agg(row_to_json(sometable_rows)) | |
) | |
FROM (SELECT * FROM sometable | |
ORDER BY "time" | |
LIMIT 10 OFFSET 0) | |
sometable_rows; |
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
const ApeECS = require('ApeECS'); | |
const Pixi = require('pixi.js'); | |
const world = new ApeECS.World(); | |
class Sprite extends ApeECS.Component { | |
static properties = { | |
x: 0, | |
y: 0, | |
layer: '', | |
texturePath: '', |
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 tick = 0; | |
class BasicObject { | |
constructor() { | |
this.x = 0; | |
this.y = 0; | |
this.updated = 0; | |
} | |
} |
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
// This file was initially generated by Windows Terminal Dev 0.0.1.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
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
class BaseComponent { | |
constructor(ecs, initialValues) { | |
Object.defineProperty(this, 'ecs', { enumerable: false, value: ecs }); | |
Object.defineProperty(this, 'type', { enumerable: false, value: this.constructor.name }); | |
Object.defineProperty(this, '_values', { enumerable: false, value: {} }); | |
Object.defineProperty(this, 'id', { enumerable: true, value: componentId }); | |
this.lastTick = this.ecs.ticks; | |
componentId++; |
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
using System; | |
using System.Runtime.InteropServices; | |
using System.Security.Principal; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Collections.Generic; | |
namespace LoginImpersonate | |
{ | |
internal class Impersonation : IDisposable | |
{ |
NewerOlder