Skip to content

Instantly share code, notes, and snippets.

View jeffdrumgod's full-sized avatar

Jefferson Rafael Kozerski jeffdrumgod

View GitHub Profile
@jeffdrumgod
jeffdrumgod / content_script.js
Created January 23, 2018 23:11 — forked from adammw/content_script.js
Chrome Extension for Debugging Secure Websockets on Spotify Web Player. Clone the repo, install extension as unpacked then navigate to `https://play.spotify.com/?ap=wss://ash1-linkap-a1.ap.spotify.com:443`
(function debugify_content_script(){
console.log('debugify content script running');
var nativeWebSocket = window.WebSocket;
var requests = window.requestLog = {};
var WebSocket = window.WebSocket = function(uri) {
console.log('new WebSocket created', uri);
this.websocket = new nativeWebSocket(uri);
this.websocket.onopen = this.onOpen.bind(this);
this.websocket.onmessage = this.onMessage.bind(this);
this.listeners = {onmessage: null, onopen: null};
@jeffdrumgod
jeffdrumgod / only numbers.js
Created October 2, 2013 04:09
Only Numbers JavaScript
function onlyNumbvers(El){
El.keydown(function(event) {
// Allow: backspace, delete, tab, escape, and enter
if ( event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
// Allow: Ctrl+A
(event.keyCode == 65 && event.ctrlKey === true) ||
// Allow: home, end, left, right
(event.keyCode >= 35 && event.keyCode <= 39)) {
// let it happen, don't do anything
return;
@jeffdrumgod
jeffdrumgod / http-benchmark.md
Created April 28, 2023 02:18 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@jeffdrumgod
jeffdrumgod / vtex-skujson-example.json
Last active September 20, 2022 20:05
vtex-skujson-example.json
{
"productId": 18190,
"name": "Vestido curto canelado manga bufante",
"salesChannel": "1",
"available": true,
"displayMode": "especificacao",
"dimensions": [
"Tamanho"
],
"dimensionsInputType": {
$(document).ajaxStart(function () {
ShowBusy();
});
$(document).ajaxStop(function () {
HideBusy();
});
function ShowBusy() {
$('#ajaxBusy').hide();
@jeffdrumgod
jeffdrumgod / russia-ddos.md
Created March 2, 2022 21:44 — forked from sergeyzenchenko/russia-ddos.md
Russia DDOS list
@jeffdrumgod
jeffdrumgod / http_request.php
Created October 16, 2021 17:48 — forked from afair/http_request.php
PHP Function to make a remote HTTP request (POST, Authentication, API, Files, etc.) and returns the response
<?php
/**
* Makes a remote HTTP request and returns the response.
*
* @author Allen Fair <allen.fair@gmail.com>
* @copyright 2018 Allen Fair
* @license https://opensource.org/licenses/MIT MIT
*
* @param string $url The full URL endpoint: "https://example.com/endpoint"
* @param array $opt An Associative Array of extended request options
@jeffdrumgod
jeffdrumgod / vtexCustomIPSCookie.js
Last active July 20, 2021 13:44
Customize VTEX IPS cookie - forcing expiration time
(function vtexCustomIPSCookie() {
function createCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
} else {
var expires = "";
}
var domain = window.location.hostname;
@jeffdrumgod
jeffdrumgod / git-snippts.md
Last active July 13, 2021 10:01
Change git history
git filter-branch -f --commit-filter '
    if [ "$GIT_COMMITTER_NAME" = "Bruno Lollato" ];
    then
            GIT_COMMITTER_NAME="Jefferson Rafael Kozerski";
            GIT_AUTHOR_NAME="Jefferson Rafael Kozerski";
            GIT_COMMITTER_EMAIL="jefferson.rafael@infracommerce.com.br";
            GIT_AUTHOR_EMAIL="jefferson.rafael@infracommerce.com.br";
            git commit-tree "$@";
 else
@jeffdrumgod
jeffdrumgod / browserdetect.js
Last active July 12, 2021 14:18
browserdetect.js
window.BrowserDetect = {
init: function () {
try {
const browser = this.getNavigator();
this.browser = browser.name;
this.version = browser.version;
this.os = this.searchString(this.dataOS) || 'Unknown';
this.mobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion);
document.body.classList.add('browser-' + this.browser.toLowerCase());