Skip to content

Instantly share code, notes, and snippets.

View Hellowor1d's full-sized avatar

Hellowor1d Hellowor1d

View GitHub Profile
@callumlocke
callumlocke / .zshrc
Last active June 14, 2024 06:50
ZSH function to auto-switch to correct Node version
####
# ZSH function to auto-switch to correct Node version
# https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5
#
# - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does.
#
# - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING.
#
# - Works correctly if your .nvmrc file contains something relaxed/generic,
# like "4" or "v12.0" or "stable".
// LeetCode Hire Writeup
interface Action<T> {
payload?: T;
type: string;
}
class EffectModule {
count = 1;
message = "hello!";
@Integ
Integ / unwxapkg.py
Last active June 13, 2024 07:01 — forked from feix/unwxapkg.py
A useful tool for unpack wxapkg file with python3 surport.
# coding: utf-8
# py2 origin author lrdcq
# usage python3 unwxapkg.py filename
__author__ = 'Integ: https://github.com./integ'
import sys, os
import struct
class WxapkgFile(object):
@linchpinstudios
linchpinstudios / fabric.arrow.js
Last active December 25, 2023 18:27
Fabric JS Arrow
fabric.Arrow = fabric.util.createClass(fabric.Line, {
type: 'Arrow',
initialize: function(element, options) {
options || (options = {});
this.callSuper('initialize', element, options);
},
toObject: function() {
@zerolab
zerolab / git-delete-history.sh
Last active November 9, 2023 16:29
Script to permanently delete files/folders form your git repository
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
@zerolab
zerolab / git-large-files.py
Created July 20, 2016 13:33
Find large files in git repo
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python script to find the largest files in a git repository.
# The general method is based on the script in this blog post:
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
#
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
@frontenddeveloping
frontenddeveloping / pdfjs-file-parser.js
Created January 18, 2016 16:32
Parse uploaded pdf file by PDF.js for number of pages and count links
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-shim.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
@farnabaz
farnabaz / arrow.fabric.js
Created May 22, 2015 23:29
fabric.js arrow shape
//
// Arrow for fabric.js
//
(function($){
$.Arrow = $.util.createClass($.Line, $.Observable, {
initialize: function(e,t) {
this.callSuper("initialize", e, t)
this.set({type:'arrow'});
},
_render: function(e) {
@vitorbritto
vitorbritto / rm_mysql.md
Last active June 21, 2024 17:50
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@darbicus
darbicus / icosahedron.js
Last active September 26, 2022 08:28
3d icosahedron on a 2d canvas
function Point3d(a, c, b) {
this.x = (a === undefined) ? 0 : a;
this.y = (c === undefined) ? 0 : c;
this.z = (b === undefined) ? 0 : b;
this.fl = 400;
this.vpX = 0;
this.vpY = 0;
this.cX = 0;
this.cY = 0;
this.cZ = 0