Skip to content

Instantly share code, notes, and snippets.

View anishpateluk's full-sized avatar

Anish anishpateluk

  • London, United Kingdom
  • 02:49 (UTC +01:00)
View GitHub Profile
@colophonemes
colophonemes / create_triggers
Last active February 1, 2025 14:53
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@dehamzah
dehamzah / scp-cheatsheet.md
Last active January 22, 2026 08:44
SCP Cheatsheet

Basic Syntax

$ scp source_file_path destination_file_path

Uploading

Single file

@DavidEdwards
DavidEdwards / GOG_Gangsters_Readme.txt
Last active January 22, 2018 07:05
A guide to playing Gangsters on modern hardware
Guide to playing Gangsters on Windows 10
---
0. Download and install "Oracle VM VirtualBox": https://www.virtualbox.org/
1. Download the "Windows XP Mode" installer: https://goo.gl/KvAb9O
2. This install only "works" on Windows 7. However, you can extract it.
3. Open the "WindowsXPMode_en-us.exe" file that you download with WinRAR or 7Zip (or your archiving
software of choice) and extract the files within.
4. Open the "sources" directory
5. Open the "xpm" file with WinRAR or 7Zip (or your archiving software of choice) and extract "VirtualXPVHD".
@paulirish
paulirish / what-forces-layout.md
Last active May 14, 2026 17:39
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@Horusiath
Horusiath / example.fs
Last active May 30, 2022 13:03
Akka.NET F# API PreStart and PostStop handling
let aref =
spawn system "actor"
<| fun mailbox ->
printf "pre-start" // this section works like pre-start
mailbox.Defer (fun () -> printf "post-stop") // this registers a function to be called on PostStop
let rec loop () =
actor {
let! msg = mailbox.Receive ()
// do some work
return! loop ()
@needim
needim / mediaqueries.css
Last active April 4, 2024 23:23
Device Specific CSS Media Queries Collection
/*
Based on:
1. http://stephen.io/mediaqueries
2. https://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* iPhone X in portrait & landscape */
@media only screen
and (min-device-width : 375px)
and (max-device-width : 812px)
@hbsdev
hbsdev / clean_py.sh
Last active November 11, 2025 17:52 — forked from joelverhagen/clean_py.sh
Recursively remove all .pyc files and __pycache__ directories in the current directory.
#!/bin/sh
# recursively removes all .pyc files and __pycache__ directories in the current
# directory
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf
@skwasha
skwasha / .dockercfg.template
Last active August 7, 2018 13:40
Deploying Meteor to AWS Elastic Beanstalk as a Docker image from Github via CircleCI
{
"https://index.docker.io/v1/": {
"auth": "<base64 encoded Docker username:password>",
"email": "<Docker Account Email>"
}
}
@yiwenl
yiwenl / JsBlobSaveJson
Last active September 25, 2023 18:35
Javascript using Blob to save json file
var saveJson = function(obj) {
var str = JSON.stringify(obj);
var data = encode( str );
var blob = new Blob( [ data ], {
type: 'application/octet-stream'
});
var url = URL.createObjectURL( blob );
var link = document.createElement( 'a' );
@akimboyko
akimboyko / 01_SayHello.fsx
Last active May 28, 2023 13:00
Samples from "Actor-based Concurrency with F# and Akka.NET" http://bit.ly/FSharpAkkaNET
#time "on"
#load "Bootstrap.fsx"
open System
open Akka.Actor
open Akka.Configuration
open Akka.FSharp
open Akka.TestKit
// #Using Actor