Skip to content

Instantly share code, notes, and snippets.

View bobbigmac's full-sized avatar

Bob Davies bobbigmac

View GitHub Profile
//login query example
app.post("/verify", (request, response) => {
const req=request.body
var output={}
try
{
var info = jwt.verify(req.token, privateKey, { algorithm: 'HS512' });
output["verified"]=1;
}catch(err)
{
@iffy
iffy / .gitignore
Last active April 17, 2024 07:19
Example using electron-updater with `generic` provider.
node_modules
dist/
yarn.lock
wwwroot
@pjobson
pjobson / FFMPEG_Notes.md
Last active April 24, 2024 05:00
FFMPEG Notes

Some Recipies for ffmpeg Usage

I screw around with ffmpeg a lot, here are some recipies which I frequently use.

Cropping

You need 4 variables:

  • W - Width of Output Video
  • H - Height of Output Video
@mailmindlin
mailmindlin / proxy-polyfill.js
Last active August 25, 2017 16:45
Proxy Polyfill for major webbrowsers
/**
* Partial polyfill for Proxy. For details, see https://gist.github.com/mailmindlin/640e9d707ae3bd666d70
*/
function Proxy (target, handler, revocable) {
var self = this;//because life
//override Object.prototype properties
Object.defineProperty(this, '__lookupGetter__', {value: target.__lookupSetter__.bind(target)});
Object.defineProperty(this, '__lookupSetter__', {value: target.__lookupSetter__.bind(target)});
Object.defineProperty(this, '__defineGetter__', {value: target.__defineGetter__.bind(target)});
Object.defineProperty(this, '__defineSetter__', {value: target.__defineSetter__.bind(target)});
@SebCorbin
SebCorbin / Enregistrer la selection en SVG.jsx
Created April 7, 2015 14:25
Illustrator script - Save selection as SVG
/*
* Export selection to SVG - export_selection_as_SVG
* (Adapted from Layers to SVG 0.1 - export_selection_as_SVG.jsx, by Rhys van der Waerden)
*
* @author SebCorbin
*/
// Variables
var ignoreHidden = true,
svgExportOptions = (function () {
@alojzije
alojzije / connectHTMLelements_SVG.png
Last active May 13, 2024 08:16
Connect two elements / draw a path between two elements with SVG path (using jQuery)
connectHTMLelements_SVG.png
@brandonb927
brandonb927 / gist:9587436
Created March 16, 2014 18:13
Simple JSON database with Node.JS

From: http://run-node.com/littlest-database-that-could/

I've written numerous tiny databases. They don't have much features, but they don't need much features. Usually I'm looking for fast simple key/value stores and Node never disappoints. The point here is, why abstract key value store when JS gives us one for free, as it's most basic component: object.

Will it meet every need? No. But it will meet ALOT of scenarios.

In memory JS object lookups, were talking hundreds of thousands of lookups (you'll easily flood http before the db), and save hundreds of thousands of records in a JSON file written to disk. Not a 200ms r/t to some hosted Redis. Hey, that's fine if that's your thing.

Here's the requirements:

@sevastos
sevastos / aws-multipartUpload.js
Last active October 8, 2023 10:43
Example AWS S3 Multipart Upload with aws-sdk for Node.js - Retries to upload failing parts
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload
var fs = require('fs');
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws-config.json');
var s3 = new AWS.S3();
// File
var fileName = '5.pdf';
var filePath = './' + fileName;
var fileKey = fileName;
@matshofman
matshofman / gist:4150213
Created November 26, 2012 19:48
Star data to JSON
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace RADECtoALTAZ