Skip to content

Instantly share code, notes, and snippets.

@igorferreira
igorferreira / youtube-unsubscribe.js
Last active September 20, 2022 09:44
Unsubscribe YouTube Script
// first access url: https://www.youtube.com/feed/channels
var i = 0;
var count = document.querySelectorAll("ytd-channel-renderer:not(.ytd-item-section-renderer)").length;
myTimer();
function myTimer () {
if (count == 0) return;
el = document.querySelector('.ytd-subscribe-button-renderer');
@alsor
alsor / stand_by_me_spec.rb
Created April 7, 2016 09:23
Stand by me
require 'rails_helper'
class Tear
end
class Me
attr_accessor :you
def afraid?
!you.present?
@jveldboom
jveldboom / onix_code_list.sql
Created July 26, 2013 13:38
ONIX fields and values SQL
DROP TABLE IF EXISTS `onix_code_list`;
CREATE TABLE `onix_code_list` (
`list_id` int(11) unsigned NOT NULL,
`values` varchar(20) DEFAULT NULL,
`name` varchar(100) DEFAULT '',
`notes` text,
`revision` int(11) unsigned DEFAULT NULL,
KEY `list_id` (`list_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@jdcrensh
jdcrensh / Base62.java
Last active January 28, 2024 12:25
Class to encode a string into base 62 (character set [a-zA-Z0-9]) with Java. A common use case is URL shortening.
public class Base62 {
public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
public static final int BASE = ALPHABET.length();
private Base62() {}
public static String fromBase10(int i) {
StringBuilder sb = new StringBuilder("");
@plukevdh
plukevdh / leven.ex
Created November 28, 2012 18:17
Levenshtein in elixir
defmodule Levenshtein do
def first_letter_check(one_letter, two_letter) do
case one_letter == two_letter do
true -> 0
false -> 1
end
end
def distance(string_1, string_1), do: 0
def distance(string, ''), do: :string.len(string)