Skip to content

Instantly share code, notes, and snippets.

@feyhi
feyhi / leetcode_crawler.py
Last active December 26, 2023 00:34
Get your Leetcode submission history
import time
import requests
import datetime
import cPickle as pickle
from bs4 import BeautifulSoup
LOGIN = "login"
PASSWD = "password"
LOGIN_URL = "https://leetcode.com/accounts/login/"
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
alert('hello ' + document.location.href);
@bowmanb
bowmanb / SavedTabsFragment.java
Last active December 6, 2020 23:52
A basic Android ExpandableListFragment (SavedTabsFragment) example.
package com.advinture.ukuleletabs.fragments;
import android.app.ExpandableListActivity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
@gpfeiffer
gpfeiffer / extended_gcd.rb
Last active January 29, 2022 14:16
Extended Euclidean Algorithm in Ruby
#############################################################################
##
## extended_gcd.rb
##
## given non-negative integers a > b, compute
## coefficients s, t such that gcd(a, b) == s*a + t*b
##
def extended_gcd(a, b)
# trivial case first: gcd(a, 0) == 1*a + 0*0