Skip to content

Instantly share code, notes, and snippets.

View custom-material.css
@import "https://rawgit.com/AlexFlipnote/Discord_MaterialTheme/master/theme.css";
/* For Discord_MaterialTheme, replace the default red no-border indicator to white black border circle. */
.guilds-wrapper .guilds .guild.selected.unread:before,
.guilds-wrapper .guilds .guild.selected:before,
.guilds-wrapper .guilds .guild.unread:before {
background: #eaeaea;
box-shadow: 0px 1px 0 rgba(0, 0, 0, 0.3), inset 0 1px 0 hsla(0, 0%, 100%, .15);
border: 1px solid #212121;
height: 11px;
@ngbeslhang
ngbeslhang / quak.txt
Last active Mar 28, 2017
Ctrl + F to search for Pokemon's name and corresponding key | Don't ask me why it's off center
View quak.txt
TIP: If you want to find the exact Pokedex number, surround one space between the number in Ctrl+F, e.g. " 1 " gives you exactly 1 result.
------------------------------------------------------------
| | | |
| Key | Name | Region |
| | | |
|----------------------------------------------------------|
| | | |
| 1 | Bulbasaur | Kanto |
| | | |
@ngbeslhang
ngbeslhang / download.py
Created Apr 15, 2017
Automatically download songs from links in a txt file because mom pls
View download.py
import youtube_dl
ydl = youtube_dl.YoutubeDL({
'format': 'bestvideo+bestaudio',
"nocheckcertificate": True,
"keepvideo": True
})
with open("songs.txt", 'r') as q:
ydl.download(q.readlines())
View regex-weburl.js
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@ngbeslhang
ngbeslhang / dot_dict.py
Created Jul 29, 2017 — forked from floer32/dot_dict.py
DotDict is a variation of the classic "Bunch" recipe - just a dictionary, with all the normal dictionary methods, but the attributes are accessible by dot notation. Use this when you just really want to turn some dictionaries (i.e. from JSON) into something like JavaScript objects. Achieved with very little code. See bottom of docstring for Stac…
View dot_dict.py
class DotDict(dict):
""" A dictionary whose attributes are accessible by dot notation.
This is a variation on the classic `Bunch` recipe (which is more limited
and doesn't give you all of dict's methods). It is just like a dictionary,
but its attributes are accessible by dot notation in addition to regular
`dict['attribute']` notation. It also has all of dict's methods.
.. doctest::
@ngbeslhang
ngbeslhang / README.md
Created Aug 13, 2018
Malaysian Phone Number Regex
View README.md
View gist:1779e1ee2f076c8fbda1a73b66ba1b09
### Keybase proof
I hereby claim:
* I am ngbeslhang on github.
* I am ngbeslhang (https://keybase.io/ngbeslhang) on keybase.
* I have a public key ASBevUCC8AlHQ3u-T8B_vVJTlb-Q3UYVtRoLnuFo5cV4TQo
To claim this, I am signing this object:
View keybase.md

Keybase proof

I hereby claim:

  • I am ngbeslhang on github.
  • I am ngbeslhang (https://keybase.io/ngbeslhang) on keybase.
  • I have a public key ASCmWDSopYy_a-jGhsdkc2kJuKoJpEz5xFGI8NCA93i2DQo

To claim this, I am signing this object:

@ngbeslhang
ngbeslhang / playlist_creator.py
Last active May 20, 2021
Python 3 script that converts Youtube playlists through youtube-dl into format-agnostic VLC-compatible .m3u8 playlist file in the order of the source playlist
View playlist_creator.py
# MADE AND TESTED ONLY FOR YOUTUBE PLAYLISTS
# Requires youtube-dl option `--write-info-json` to work
# For this to work, you need to put this script into the directory (folder) of the videos and JSON files
import os
import json
# Separate JSON metadata files and media files
for path, dirname, filenames in os.walk(os.getcwd()):
json_filenames = [name for name in filenames if name.endswith('.info.json')]
media_filenames = [name for name in filenames if not name.endswith('.info.json')]
@ngbeslhang
ngbeslhang / request_time.py
Last active Jul 8, 2022 — forked from andrewwatts/request_time.py
urllib2 vs urllib3 vs requests; updated for Python 3
View request_time.py
#!/usr/bin/env python3
import time
# REMEMBER TO CHANGE THE VARIABLES BELOW BEFORE YOU RUN THE SCRIPT
_URL = 'http://localhost/tmp/derp.html'
_NUMBER = 1000
def test_urllib2():