Skip to content

Instantly share code, notes, and snippets.

C:\Program Files\Notepad++\notepad++.exe -n%line% "%path%"
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active May 13, 2024 14:02
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@Semnodime
Semnodime / kmeansExample.py
Last active May 13, 2024 14:02 — forked from iandanforth/kmeansExample.py
A pure python3 compatible implementation of K-Means clustering. Optional cluster visualization using plot.ly.
"""
This is a pure Python3 implementation of the K-means Clustering algorithm.
It is based on a GitHub Gist which uses Python2:
https://gist.github.com/iandanforth/5862470
I have refactored the code and to assure the code obeys Python Enhancement Proposals (PEPs) rules.
After reading through this code you should understand clearly how K-means works.
This script specifically avoids using numpy or other more obscure libraries.
It is meant to be *clear* not fast.
I have also added integration with the plot.ly plotting library.
So you can see the clusters found by this algorithm. To install plotly run:
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 13, 2024 14:01
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@jonasraoni
jonasraoni / Flattener.cs
Created July 14, 2018 14:46
Flatten Array in C#
using System;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Extends the Array with the Flatten method
/// </summary>
public static class Flattener {
/// <summary>
/// Given a N-dimensional array, flattens it into a new one-dimensional array without modifying the elements' order
@iandanforth
iandanforth / kmeansExample.py
Last active May 13, 2024 14:00
A pure python implementation of K-Means clustering. Optional cluster visualization using plot.ly.
#############################################################################
# Full Imports
from __future__ import division
import math
import random
"""
This is a pure Python implementation of the K-means Clustering algorithmn. The
original can be found here:
@ShreyKumar
ShreyKumar / countriesAddressPostal.js
Last active May 13, 2024 14:02
List of countries and their respective postal codes with ranges (August 2020)
// Country list source: https://www.dhl.com/en/country_profile.html#.XwODEJNKjOQ
// Country abbreviation source: https://planetarynames.wr.usgs.gov/Abbreviations
// Postal code: https://gist.githubusercontent.com/jamesbar2/1c677c22df8f21e869cca7e439fc3f5b/raw/21662445653ac861f8ab81caa8cfaee3185aed15/postal-codes.json
// Postal code: https://en.wikipedia.org/wiki/List_of_postal_codes
// Country/territory items with no postal code regexes or ranges either do not require postal codes
// or there may not be enough information for that country/territory
export const COUNTRY_ADDRESS_POSTALS = [{
abbrev: 'AF',
@g-berthiaume
g-berthiaume / Useful GCC Compiler Options.md
Created December 31, 2018 18:27
A useful list of gcc compiler options

Useful GCC Compiler Options

A non exhaustive list of gcc compiler options.

$ gcc myprog.c -o myprog -Wall -Wextra -pedantic -std=c11 [...]

Optimization:

@kashifulhaque
kashifulhaque / NvChad.md
Last active May 13, 2024 13:55
Neovim stuff with NvChad

Neovim keybinds

  • Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
  • _ (underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)
    • 0 (zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
  • $ (dollar) to move the cursor at the end of line (doesn't switch to insert mode)
  • d$ will delete from wherever your cursor is till the end of the line
  • f<character> to move cursor to the first occurrence of <character>
    • f( to move cursor to first occurence of (
  • t<character> to move cursor to upto but not on the first occurrence of <character>
  • t( to move cursor to first occurence of (