Skip to content

Instantly share code, notes, and snippets.

View GeorgeDettmer's full-sized avatar

George GeorgeDettmer

  • Leicester, United Kingdom
View GitHub Profile
@aradalvand
aradalvand / DockerfileForSvelteKit.md
Last active June 19, 2024 06:41
Dockerfile and .dockerignore for SvelteKit:

*This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have already installed and configured the adapter.

Dockerfile:

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@neelbhanushali
neelbhanushali / usb-connected-hand-held-barcode-scanner-input.js
Last active June 4, 2024 14:56
Javascript for detecting usb connected - hand held - barcode scanner input
// Author: Neel Bhanushali <neal.bhanushali@gmail.com>
document.addEventListener('keydown', function(e) {
// add scan property to window if it does not exist
if(!window.hasOwnProperty('scan')) {
window.scan = []
}
// if key stroke appears after 10 ms, empty scan array
if(window.scan.length > 0 && (e.timeStamp - window.scan.slice(-1)[0].timeStamp) > 10) {
window.scan = []
@hectorguo
hectorguo / getLocalIP.js
Last active March 18, 2024 06:21
Get local IP address through Javascript
/**
* Get Local IP Address
*
* @returns Promise Object
*
* getLocalIP().then((ipAddr) => {
* console.log(ipAddr); // 192.168.0.122
* });
*/
function getLocalIP() {
@Fusselwurm
Fusselwurm / marker.sqf
Last active December 17, 2015 00:09
In ArmA, set a fuzzy marker on a player's position
private ["_markerPos", "_inner_marker", "_helper_marker"];
trackingPrecision = 50; //marker precision (radius)
gpsSleepTimeMin = 120;
gpsSleepTimeMax = 300;
_markerPos = (getPos _this);
_inner_marker = createMarker ["agentmarker", _markerPos];
@aras-p
aras-p / preprocessor_fun.h
Last active June 21, 2024 12:20
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,