Skip to content

Instantly share code, notes, and snippets.

View dcpesses's full-sized avatar

Danny Pesses dcpesses

View GitHub Profile
@dcpesses
dcpesses / main.js
Last active November 9, 2023 16:05
Spotify 30ish Skip
/*
Plays the first 30-40 seconds of each song in your Spotify queue.
Intended to fix your personalized suggestions when someone else uses your account
Based on https://do.that.ee/let-the-spotify-play/
To use:
Login to Spotify in your web browser.
Open your browser's JavaScript Console.
Copy and execute the code below code.
@dcpesses
dcpesses / UpdateTwitchChatTitle.user.js
Last active November 14, 2021 16:23
UserScript: Append Streamer Name To Twitch Chat Page Title
// ==UserScript==
// @name Append Streamer Name To Twitch Chat Page Titles
// @namespace https://gist.github.com/dcpesses
// @version 1.0.1
// @description Adds the streamer's username to the title of Twitch chat popout pages to help indicate which stream you're viewing.
// @author dcpesses
// @match https://twitch.tv/popout/*
// @match https://www.twitch.tv/popout/*
// @grant none
// ==/UserScript==
#!/bin/bash
brew_command=/usr/local/bin/brew
brew_cask_command="$brew_command cask"
echo '#!/bin/bash'
echo ''
echo 'trap ctrl_c INT'
echo 'function ctrl_c() {'
echo 'echo "** Trapped CTRL-C"'
@dcpesses
dcpesses / index.js
Created March 29, 2017 00:46
HTTPS Proxy Server in node.js
// via http://stackoverflow.com/questions/8165570/https-proxy-server-in-node-js
// Install npm dependencies first
// npm init
// npm install --save url@0.10.3
// npm install --save http-proxy@1.11.1
// node ./index.js
var httpProxy = require("http-proxy");
var http = require("http");
var url = require("url");
var net = require('net');
@dcpesses
dcpesses / ApacheHTTPSConfig.md
Created June 5, 2016 17:41 — forked from nrollr/ApacheHTTPSConfig.md
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@dcpesses
dcpesses / Chromecast batch conversion script
Last active March 3, 2017 21:07 — forked from steventrux/Chromecast batch conversion script
A bash script to batch convert video files for chromecast compatibility
#! /bin/bash
# Batch Convert Script by StevenTrux
#
# Modified by Danny Pesses to handle filenames with spaces and display color highlighting
#
# The Purpose of this Script is to batch convert any video file to mp4 or mkv format for chromecast compatibility
# this script only convert necessary tracks if the video is already
# in H.264 format it won't convert it saving your time!
@dcpesses
dcpesses / laravel-intro.markdown
Last active August 29, 2015 14:27
Introduction to Laravel Framework v4.2

Please note, this documentation originally appeared at http://laravelbook.com/laravel-introduction/ and has been updated to fix several issues and/or outdated code.

-D


Introduction to Laravel Framework

This book is about Laravel, a web application development framework that saves you time and effort and makes web development a joy. Laravel has shaken up the PHP community in a big way - especially when you consider that version 1.0 of Laravel was only a couple of years ago. It has been generating a lot of buzz with the promise of making web applications fast and simple to create. Using Laravel, you can build and maintain high-quality web applications with minimal fuss.

@dcpesses
dcpesses / mysql_splitdump.php
Last active August 29, 2015 14:23
Splits a LARGE sql dump into individual sql files of each database.
<?php
/**
* mysql_splitdump.php
*
* Splits a LARGE sql dump into individual sql files of each database
*
* Based off of example code from
* http://www.codediesel.com/php/splitting-large-mysql-dump-files/
*
# With a little help from http://www.raspberrypi.org/forums/viewtopic.php?f=78&t=85041
sudo raspi-config
# Expand Filesystem
# Advanced Options -> Audio -> Change to 3.5 Headphone
# Internationalisation Options
sudo reboot
# if locale errors show up,
sudo dpkg-reconfigure locales
# Uncheck en_UK.UT8
# Check en_US.UTF8
@dcpesses
dcpesses / photoreflect.js
Last active July 5, 2023 11:41
Re-enable right-click & add Download links to thumbnail pages on PhotoReflect pages.
/*
Copy the single line of code below, then add it as a new bookmark to your web browser of choice:
javascript:(function(){document.body.appendChild(document.createElement('script')).src='http://gist.githubusercontent.com/dcpesses/9652778/raw';})();
Then browse to the thumbnails of the album, click on that bookmark, and...enjoy!
*/
document.oncontextmenu=document.body.oncontextmenu = new Function("return true");