Skip to content

Instantly share code, notes, and snippets.

View Sanfam's full-sized avatar

Andrew Sanjanwala Sanfam

  • The Salzman Group
  • Canandaigua, NY
View GitHub Profile
@redphx
redphx / stock_alert.json
Created May 23, 2022 10:18
Stock alert using Node-RED
[
{
"id": "bbd65f58de8fc93e",
"type": "group",
"z": "5501e19c.72a0c",
"name": "Coral USB",
"style": {
"label": true
},
"nodes": [
const sanityClient = require('@sanity/client');
const crypto = require('crypto');
const {
SANITY_API_TOKEN,
SANITY_PROJECT_ID,
SANITY_DATASET,
SHOPIFY_SECRET
} = process.env;
@brianhanifin
brianhanifin / sonoff_s31_01
Last active November 7, 2019 16:10
See https://github.com/brianhanifin/esphome-config for current configuration + more.
# Sonoff S31 Power Monitoring Plug
#
substitutions:
devicename: sonoff_s31_01
upper_devicename: Sonoff S31 01
esphome:
name: ${devicename}
platform: ESP8266
board: esp01_1m
@jasperkennis
jasperkennis / single-range-slider.js
Last active March 25, 2019 20:26
Single range slider for Slgolia
/**
* Custom implementation of range slider, with a single slider instead of two.
* Defaults min to 0, and allows the max to be changed using the slider.
*
* Implementation depends on jQuery and rangeslider (http://rangeslider.js.org/)
* to be present.
*/
var $,
custom_range_slider,
@rparsi
rparsi / Json.php
Created July 9, 2018 19:06
Handle differing serialized object/data formats between magento versions...because magento devs too stupid to do it correctly
<?php
namespace YourVendorName\FrameworkOverride\Framework\Serialize\Serializer;
use Magento\Framework\Serialize\Serializer\Json as Base;
class Json extends Base
{
public function unserialize($string) // override of base class method
@hn-support
hn-support / cache-warmer.py
Last active May 21, 2025 03:37
A threaded cache warmer in python
#!/usr/bin/env python
"""
Warm the caches of your website by crawling each page defined in sitemap.xml.
To use, download this file and make it executable. Then run:
./cache-warmer.py --threads 4 --file /data/web/public/sitemap.xml -v
"""
import argparse
import multiprocessing.pool as mpool
import os.path
import re
@hn-support
hn-support / cache-warmer.sh
Created January 11, 2017 12:47
A cache warmer in bash using curl
#!/bin/bash
if [ "$#" -ne 1 ] || [ "x$1" == "x" ] ; then
echo "Usage: $0 <sitemap.xml>"
exit 0;
fi
if [ ! -f "$1" ]; then
echo "Sitemap file $1 not found! Exit!"
exit 1
@nrollr
nrollr / Commands.sh
Last active February 11, 2026 10:15
Install PHP and NGINX on Amazon Linux AMI
## Install NGINX
## when installing on Amazon Linux AMI, use:
$ sudo yum install nginx -y
## when installing on Amazon Linux 2 AMI, use
$ sudo amazon-linux-extras install nginx1.12 -y
## Install PHP and PHP-FPM
# for PHP version 7.1 use php71 and php71-fpm instead
$ sudo yum install php -y
$ sudo yum install php-fpm -y
@alirobe
alirobe / reclaimWindows10.ps1
Last active March 18, 2026 18:42
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@jamesramsay
jamesramsay / README.md
Last active December 29, 2025 14:15
Gmail: delete old emails automatically

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at https://script.google.com
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABEL_TO_DELETE: the label that should be have old messages deleted