Skip to content

Instantly share code, notes, and snippets.

Avatar

Shiv Patel shivpatel

View GitHub Profile
View gist:091e6ed56de6dcc9988b5e88f97d22ac
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
@shivpatel
shivpatel / docker-compose.yml
Created Jan 1, 2020
Example docker-compose.yml with env vars needed to pull configs via Meercall CLI
View docker-compose.yml
version: "2"
services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
MEERCALL_TAG: "production"
MEERCALL_API_KEY: "xxxx"
MEERCALL_SECRET_KEY: "xxxx"
@shivpatel
shivpatel / launch.sh
Created Jan 1, 2020
Example of Node project pulling Meercall configs before launching
View launch.sh
meercall pull $MEERCALL_TAG ./configs.json
exec node app.js
@shivpatel
shivpatel / Dockerfile
Created Jan 1, 2020
Example Dockerfile of Node project including Meercall CLI in image
View Dockerfile
FROM node:12
# Set working directory
WORKDIR /app
# Download meercall cli
RUN curl -L -o /usr/local/bin/meercall https://github.com/meercall/meercall-cli/releases/download/v1.0.0/meercall-linux && \
chmod +x /usr/local/bin/meercall
# Your existing steps go here
View keybase.md

Keybase proof

I hereby claim:

  • I am shivpatel on github.
  • I am spatel (https://keybase.io/spatel) on keybase.
  • I have a public key ASB1GnCBU9FjRUNDVykfitqMFOC5jcwzdzBCSiYwJhCbDQo

To claim this, I am signing this object:

View hdhomerun-dvr.sh
#!/bin/bash
# Usage: hdhomerun-dvr.sh "Designated Survivor" "2.1" "3600"
# Tips: Use cron to trigger the script call at the correct time
DATE="$(date +%F)"
URL="http://192.168.0.15:5004/auto/v$2?duration=$3"
FILEPATH_RAW="/my/temp/$1 $DATE.mp4"
FILEPATH_ENCODED="/my/temp/optimizer/$1 $DATE.mp4"
FILEPATH_FINAL="/my/tv-shows/"
@shivpatel
shivpatel / test.js
Created Aug 26, 2016
A simple GUID collision test
View test.js
'use strict';
// npm install guid
var Guid = require('guid');
var count = 0;
var collisions = 0;
var guids = [];
var cycleStart = Date.now();
@shivpatel
shivpatel / ticketleap-delete-all-discount-codes.js
Last active Apr 12, 2016
Delete all discount codes in TicketLeap
View ticketleap-delete-all-discount-codes.js
/*
This script will delete all discount codes in your TicketLeap account.
1. Visit http://[YOUR-ORG].ticketleap.com/admin/promote/discount-codes/?query=&sort_by=&page_size=[YOUR-#-OF-DISCOUNT-CODES]
2. Open your browser's console and paste the code below (note to change YOUR-ORG)
3. Let it run (it's set to wait 1 second between each request)
4. Close developer tools/console and refresh page to see results
Note: Discount codes that have been used by your customers cannot be deleted.
*/
$(".delete").each(function(i) {
@shivpatel
shivpatel / hacking-ticketleap-2.js
Last active Mar 7, 2016
Hacking TicketLeap for Bulk Discount Codes: Looping POST Request
View hacking-ticketleap-2.js
var data = [
{"Name": "Jennifer Snowman", "Code"; "JKLJLK6H43JH5"},
{"Name": "Bob Ginger", "Code"; "HGH4G32J3K45"}
];
var entries = data.length;
for (var i = 0; i < entries; i++) {
(function(i) {
setTimeout(function() {
// the previously located request URL
@shivpatel
shivpatel / hacking-ticketleap-1.js
Last active Mar 7, 2016
Hacking TicketLeap for Bulk Discount Codes: Basic POST Request
View hacking-ticketleap-1.js
var url = ""; // enter the previously located request URL here
var body = ""; // paste the sourced form data here
$.post(url, body, function(response) {
// done
// console.log(response) to see the
// POST request's response
}, "application/x-www-form-urlencoded");
You can’t perform that action at this time.