Skip to content

Instantly share code, notes, and snippets.

View j-chimienti's full-sized avatar
🎯
Focusing

Joe j-chimienti

🎯
Focusing
View GitHub Profile
@j-chimienti
j-chimienti / delete-duplicates.py
Created January 10, 2024 18:29
delete duplicate files
import os
import hashlib
import argparse
def file_hash(filepath):
"""This function returns the MD5 hash of the file passed into it"""
hasher = hashlib.md5()
with open(filepath, 'rb') as f:
buf = f.read(65536)
while len(buf) > 0:
@j-chimienti
j-chimienti / ffmpeg-rtmp-streaming
Created February 4, 2023 20:04 — forked from shivasiddharth/ffmpeg-rtmp-streaming
Sample commands to stream Pi webcam video to RTMP sink
# Command for streaming USB Webcam to RTMP sink without audio
/usr/bin/ffmpeg -y -f v4l2 -video_size 640x480 -framerate 25 -i /dev/video0 -vcodec h264_omx -f flv rtmp://localhost/show/stream
# Command for streaming USB Webcam to RTMP sink with audio
/usr/bin/ffmpeg -y -f v4l2 -video_size 640x480 -framerate 25 -i /dev/video0 -vcodec h264_omx -c:a aac -b:a 160k -ar 44100 -f flv rtmp://localhost/show/stream
@j-chimienti
j-chimienti / index.html
Created January 14, 2023 13:22
Tilt Toggle
<svg id="mainSVG" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600">
<g id="whole">
<g id="togglePanel">
<path d="M331.5,328.5a45.5,45.5,0,0,1,0-91h115a45.5,45.5,0,0,1,0,91Z" fill="#f2f2f2"/>
<path d="M446.5,241a42,42,0,0,1,0,84h-115a42,42,0,0,1,0-84h115m0-7h-115a49.14,49.14,0,0,0-49,49h0a49.14,49.14,0,0,0,49,49h115a49.14,49.14,0,0,0,49-49h0a49.14,49.14,0,0,0-49-49Z" fill="#f4f9f6"/>
</g>
<line id="fillLine2" x1="331" y1="283" x2="446" y2="283" fill="none" stroke="#ED4D6E" stroke-linecap="round" stroke-linejoin="round" stroke-width="84"/>
<line id="fillLine1" x1="331" y1="283" x2="446" y2="283" fill="none" stroke="#A0CA4C" stroke-linecap="round" stroke-linejoin="round" stroke-width="84"/>
<g id="dragger">
<ellipse cx="330" cy="283" rx="40.5" ry="41" fill="#fcfcfc"/>
import scala.io.StdIn
import scala.sys.process._
// CHANGE ME
val bitcoinClient = "bitcoin-cli" // """docker exec btcpayserver_bitcoind bitcoin-cli -datadir="/data""""
def getNewAddress = s"$bitcoinClient getnewaddress".!!.trim
def getAddressInfo(address: String) = s"$bitcoinClient -named getaddressinfo address=$address".!!.trim
def publicKey(address: String): String = {
val info = getAddressInfo(address)
@j-chimienti
j-chimienti / countries.js
Created August 5, 2020 18:21
btcpayserver shipping checkout page
// script by IshanDemon, visit github.com/IshanDemon
var country_arr = new Array("Afghanistan", "Albania", "Algeria", "American Samoa", "Angola", "Anguilla", "Antartica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Ashmore and Cartier Island", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Clipperton Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo, Democratic Republic of the", "Congo, Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guin
<template>
<div>
<div class="row d-flex justify-content-center tick_row align-items-center">
<i class="fa fa-caret-down fa-5x" id="ticker"></i>
</div>
<div class="row d-flex justify-content-center align-items-center mb-4">
<svg :height="radius * 2" :width="radius * 2" id="roulette">
<g :style="getTransform()">
<path v-for="(piece, i) in pieces"
stroke-width="70px"
@j-chimienti
j-chimienti / fast.sh
Created September 21, 2019 14:00 — forked from nvk/fast.sh
OSX For Hackers
#!/usr/bin/env bash
##
# Install:
# curl -sL https://raw.github.com/gist/2108403/fast.sh | sh
#
# Share your feedbacks on:
# https://gist.github.com/2108403
#
# Author: @DAddYE (Twitter/Github)

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

// htlc.me
const $btn = document.querySelector("body > div.container.mb-4 > div > div.col-md-8.main-column > div.card.mb-4.payment-actions.show-on-start > div.card-body > form.action-details.preparing-receive.text-success > div:nth-child(2) > button")
const $amt = document.querySelector("body > div.container.mb-4 > div > div.col-md-8.main-column > div.card.mb-4.payment-actions.show-on-start > div.card-body > form.action-details.preparing-receive.text-success > div:nth-child(1) > div > input")
async function sleep(sec = 1) {
return new Promise(resolve => {
// Start a session.
session = db.getMongo().startSession( { readPreference: { mode: "primary" } } );
// session = db.getMongo().startSession()
employeesCollection = session.getDatabase("hr").employees;
eventsCollection = session.getDatabase("reporting").events;
// Start a transaction
session.startTransaction( { readConcern: { level: "snapshot" }, writeConcern: { w: "majority" } } );