Skip to content

Instantly share code, notes, and snippets.

@jinjier
jinjier / javdb-top250.md
Last active December 29, 2024 06:33
JavDB top 250 movies list. [Updated on 2024/12]
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active December 29, 2024 06:32
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@jamiephan
jamiephan / README.md
Last active December 29, 2024 06:30
A script to automatically add ALL items to your account in quixel

Script to add all items from quixel

As quixel is being removed, all items are free to aquire. This script is to automate the process to add items to your account (As of writing, a total of 18874 items)

Note: This script only tested in the latest version of Chrome.

How to use

  1. Copy the script from below (run.js)
  2. Login into https://quixel.com
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active December 29, 2024 06:29
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@daif
daif / iban.php
Created February 21, 2019 13:54
Check IBAN number
<?php
/**
* Value should be an IBAN number
*
*
* @param string
* @return bool
*/
function iban($str)
{
@daif
daif / file_cache_contents.php
Created January 4, 2017 16:50
Tiny Cache system
<?php
//Tiny Cache system
function file_cache_contents($url, $cache_time=360000) { // 60*60*5
$cache_dir = __DIR__.'/cache/';
$cache_file = $cache_dir.md5($url).'.cache';
@mkdir($cache_dir, 0775, true);
// return data from cached file if file exists and not expired
if(file_exists($cache_file) && filemtime($cache_file)+$cache_time >= time()) {
return(unserialize(file_get_contents($cache_file)));
}
@CompeyDev
CompeyDev / exec.luau
Last active December 29, 2024 06:27
Builder pattern class to spawn, manage and kill child processes.
--> Builder pattern class to spawn, manage and kill child processes
local process = require("@lune/process")
local task = require("@lune/task")
local option = require("./option")
local Option = option.Option
type Option<T> = option.Option<T>
local CommandBuilder = {}
@daif
daif / file_search.php
Last active December 29, 2024 06:27
search in text file
<?php
// script startup time and memory usage
$mem_usage = memory_get_usage();
$time_usage = microtime(true);
$return = 'FALSE';
$password = '070162';
// get password list file from https://github.com/danielmiessler/SecLists/tree/master/Passwords
/* don't touch the above lines */
/* ------------------------------------------------------------------- */
function divide2(a,b,mid) {
let num = 0;
let middle = mid || a >> 1;
if (middle * b == a) {
return middle;
} else {
if (middle == 1) {
return 0;
}
@daif
daif / imagehash.php
Last active December 29, 2024 06:26
a simple image hashing algorithm
<?php
function imageHash($image_file) {
// check if the file is existed and is readable
if(file_exists($image_file) && is_readable($image_file)) {
return false;
}
// get image dimensions
list($width, $height) = getimagesize($image_file);