Skip to content

Instantly share code, notes, and snippets.

View stefanhayden's full-sized avatar
💭
setting up my status

Stefan Hayden stefanhayden

💭
setting up my status
View GitHub Profile
@stefanhayden
stefanhayden / gist:e2157edfac14c7bb7b40a605a3303f14
Last active June 21, 2024 19:15
queues/ingress type finder
// Paste this in the console of the queues/ingress page of sidekiq
// spits out an array of types from the objects on the page
[...$$('#page table td:nth-child(3) div')].map(el => el.textContent).map(txt => [...(txt.matchAll(/"type\\":\\"(.+?)\\/g))].map(a => a[1]).join('-'));
@stefanhayden
stefanhayden / tidal_export.py
Created April 9, 2023 04:46
Python Script to export a CSV of all your favoriet tracks
# You need to install tidalapi using pip install tidalapi (more can be found here https://github.com/tamland/python-tidal)
# had to be fixed with https://github.com/tamland/python-tidal/pull/130
import csv
import sys
import pprint
import tidalapi
session = tidalapi.Session()

Keybase proof

I hereby claim:

  • I am stefanhayden on github.
  • I am stefanhayden (https://keybase.io/stefanhayden) on keybase.
  • I have a public key ASCsE7rF3G6Axuq4tj83B5jtGi9Pv297aN2ljCnxNSmnQgo

To claim this, I am signing this object:

@stefanhayden
stefanhayden / gist:ca36754fbfef439595cf88400e367879
Created May 16, 2018 13:27
webpack-bundle-analyzer with no labels
function removeLabel (obj) {
if (obj.label) {
obj.label = "";
}
if (obj.length > 0) {
obj.forEach(removeLabel)
}
if (obj.groups && obj.groups.length > 0) {
obj.groups.forEach(removeLabel)
}
@stefanhayden
stefanhayden / bookmarklet.js
Created July 21, 2016 00:39
Make MSNBC Now player full width
javascript:(function()%7Bdocument.querySelector('.opwatch').removeChild(document.querySelector('.opwatch__rail'))%3B%20document.querySelector('.layout-opwatch__main-wrapper').style.width%3D'100%25'%7D)()
Verifying that +sthayden is my blockchain ID. https://onename.com/sthayden
@stefanhayden
stefanhayden / gist:20fa1f7a56178d5cde55
Created May 25, 2015 05:09
User Profile Edit form with Autoform in Meteor JS
<template name="UserProfileEdit">
{{#autoForm id="UserProfileEdit" collection="Meteor.users" doc=currentUser type="update"}}
{{> afQuickField name="username"}}
{{> afQuickField name="profile.firstName"}}
{{> afQuickField name="profile.lastName"}}
{{> afQuickField name="profile.bio" rows="6"}}
{{> afQuickField name="profile.website"}}
{{#unless autoSaveMode}}
<div class="form-group">
<button type="submit" class="btn btn-primary" disabled="{{disableButtons}}">Submit</button>
@stefanhayden
stefanhayden / gist:565082dd80fea1cd8819
Created May 25, 2015 05:01
SimpleSchema for Meteor JS users collection
Schemas.UserProfile = new SimpleSchema({
firstName: {
type: String,
regEx: /^[a-zA-Z-]{2,25}$/,
optional: true
},
lastName: {
type: String,
regEx: /^[a-zA-Z]{2,25}$/,
optional: true
@stefanhayden
stefanhayden / TorqueLookRotation2D.cs
Created January 13, 2015 05:11
Unity C# - TorqueLookRotation2D
using UnityEngine;
using System.Collections;
// @stefanhayden 2015
// based on http://wiki.unity3d.com/index.php/TorqueLookRotation
// set the object's rigidbody angular drag to a high value, like 10 or 50
public class TorqueLookRotation : MonoBehaviour {
public Transform target;
@stefanhayden
stefanhayden / toggleItem jQuery plugin
Created September 29, 2009 20:44
This is a jQuery plugin to show and hide an element by using a button. also lets you change the text shown.
(function($){
$.fn.toggleItem = function(vars) {
var toggleButton = (vars.toggleButton != undefined) ? vars.toggleButton : jQuery(this);
var PreToggleText = (vars.PreToggleText != undefined) ? vars.PreToggleText : 'Show All';
var PostToggleText = (vars.PostToggleText != undefined) ? vars.PostToggleText : 'Hide All';
var toggleTarget = (vars.toggleTarget != undefined) ? vars.toggleTarget : false;
toggleButton.css('','')
toggleButton.click(function(){