Skip to content

Instantly share code, notes, and snippets.

View gaybro8777's full-sized avatar
💭
Im not gay. I'm just getting back at my dad for not getting me an xbox

Michael Corrado gaybro8777

💭
Im not gay. I'm just getting back at my dad for not getting me an xbox
View GitHub Profile
@gaybro8777
gaybro8777 / underscore_template_err.js
Created May 24, 2018 10:37 — forked from FGRibreau/underscore_template_err.js
Add the following code just after UnderscoreJS declaration to find where _.template calls are run against empty templates.
/**
* Add the following code just after UnderscoreJS declaration to find
* where _.template calls are run against empty templates.
*/
(function(old){
_.template = function(str, data) {
if(!str){
console.error("Could not load template", new Error().stack);
@gaybro8777
gaybro8777 / hash_range.js
Created May 24, 2018 10:38 — forked from FGRibreau/hash_range.js
My yesterday night 1 hour code rush: JavaScript Hash with Range-based keys
/**
* September 20 night: 1 hour code rush
* @FGRibreau
*
* Requirements
* ------------
* The aim of this code rush is to enable developers to define a "range hash map"
* in a very expressive way (without if/then/else).
*
* Data-set
@gaybro8777
gaybro8777 / uglifyjs-benchmark-results.md
Created May 24, 2018 10:39 — forked from FGRibreau/uglifyjs-benchmark-results.md
Real-world benchmark results of UglifyJS v1 vs UglifyJS v2

Compressing 4 bundles with Pound (npm view pound) with JavaScript production code from https://redsmin.com


UglifyJS v1

  • times: 37720ms 36971ms
  • output size: 533Ko, 479Ko, 120Ko, 538Ko
@gaybro8777
gaybro8777 / log_deadlocks.sh
Created May 27, 2018 22:40 — forked from colinmollenhour/log_deadlocks.sh
Log Innodb Deadlocks
#!/bin/bash
dir=/root/deadlocks
[ -d $dir ] || mkdir -p $dir
cd $dir || { echo "Could not cd to $dir"; exit 1; }
mysql -be 'show engine innodb status;' \
| sed 's/\\n/\n/g' \
| awk '/TRANSACTIONS/{flag=0}flag;/LATEST DETECTED DEADLOCK/{flag=1}' \
> latest.txt
@gaybro8777
gaybro8777 / optimize_media.sh
Created May 27, 2018 22:40 — forked from colinmollenhour/optimize_media.sh
Optimize PNG and JPEG images - incrementally
#!/bin/bash
#
# Optimize all jpg and png files in the cwd
# Run it again to optimize new files since the last run
#
# Example:
# echo "optimize_media.sh > /tmp/optimize.log" | sudo -u www-data bash -s
#
# Colin Mollenhour 2016
var server = {
"development": "http://localhost:8000/",
"production": "http://myapp-production.herokuapp.com/",
"staging": "http://myapp-staging.herokuapp.com/"
}[process.env.NODE_ENV || "development"] + "myquery?parameter=VALUE";
import time
import random
import re
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException
from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
From f01f8991d2cd4610c0f4284bf7409e999e47b840 Mon Sep 17 00:00:00 2001
From: Sokolov Yura aka funny_falcon <[email protected]>
Date: Mon, 12 Dec 2016 14:23:17 +0300
Subject: [PATCH] load.c: reduce memory usage of loaded_features_index
Use integer hashsum instead of string as a key in loaded_features_index.
Do not use ruby strings for substring operation, just plain pointer
and length.
---
load.c | 41 ++++++++++++++++++++---------------------
@palewire
palewire / notebook.ipynb
Last active July 12, 2025 07:35
Rotating proxy scraper example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tacomonster
tacomonster / AutoType.py
Created September 15, 2018 14:29
Automating Typing Program
#1431, 25
#175, 27
"""
Select right side of the screen where text editor is and type one line
After typing on line go back to terminal and ask for user to hit Enter to continue on to the
next line.
"""
import pyautogui
import random