Skip to content

Instantly share code, notes, and snippets.

View vu3jej's full-sized avatar
๐ŸŒด
On vacation

vu3jej

๐ŸŒด
On vacation
View GitHub Profile
location ^~ /.well-known/ {
# Alias must point to the folder itself and end with a slash
alias /home/ubuntu/static_assets/.well-known/;
# Ensure browsers treat them as JSON
default_type application/json;
# Allow cross-origin (needed for some validators)
add_header Access-Control-Allow-Origin "*";
{
"breadcrumbs": [
{
"name": "ๆคœ็ดข็ตๆžœ 4,000 ไปฅไธŠ ใฎใ†ใก 1-48ไปถ"
},
{
"name": "\"roblox\""
}
],
"products": [
@vu3jej
vu3jej / postgresql.mk
Created July 9, 2020 02:15 — forked from Ignas/postgresql.mk
Set up for a local postgresql database using a Makefile
export PGPORT ?= 4488
PG_PATH ?= $(shell if test -d /usr/lib/postgresql/9.1; then echo /usr/lib/postgresql/9.1; else echo /usr/lib/postgresql/8.4; fi)
PG_DIR = ${PWD}/instance/var
PG_DATA = ${PG_DIR}/data
PG_RUN = ${PG_DIR}/run
PG_LOG = ${PG_DIR}/log
PG_SOCKET = ${PG_RUN}/.s.PGSQL.${PGPORT}
PGPARAMS = -D ${PG_DATA} -o "-F -c unix_socket_directory=${PG_RUN} -c custom_variable_classes='busy' -c busy.active_user=0" -l ${PG_LOG}/pg.log
@vu3jej
vu3jej / waitForKeyElements.js
Created December 23, 2019 13:49 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@vu3jej
vu3jej / _processed_tweets-2017-05-08.ldj
Last active May 8, 2017 07:19
Cleaned tweets -- Japanese-Language Proficiency Test (N5)
{"options": {"A": "ใ”ใฏใ‚“", "C": "ใ‚„ใ•ใ„", "B": "ใŠใซใŽใ‚Š", "D": "ใใ ใ‚‚ใฎ"}, "key": "C. ใ‚„ใ•ใ„", "stem": "A:ใ€Œ้‡Ž่œใ€ใ‚‚้ฃŸ(ใŸ)ในใชใ•ใ„๏ผ B:ใ„ใ‚„ใ€ใใ‚‰ใ„๏ผ"}
{"key": "ใง", "stem": "ใ™ใ—ใฏใ€ใฆ๏ผˆ ๏ผ‰้ฃŸในใ‚‹ใ‚‚ใฎใงใ™ใ€‚"}
{"options": {"A": "ใ›ใ‚“ใ›", "C": "ใ›ใฃใ›ใ‚“", "B": "ใใ‚“ใ›ใ‚“", "D": "ใ›ใ‚“ใ›ใ„"}, "key": "D. ใ›ใ‚“ใ›ใ„", "stem": "ใ€Œๅ…ˆ็”Ÿใ€ใฏใฉใ“ใซใ„ใพใ™ใ‹๏ผŸ"}
{"options": {"A": "ใ‚†ใ†ใณใ‚“ใใ‚‡ใ", "C": "ใจใ—ใ‚‡ใ—ใค", "B": "ใŽใ‚“ใ“ใ†", "D": "ใปใ†ใฉใ†ใใ‚‡ใ"}, "key": "A. ใ‚†ใ†ใณใ‚“ใใ‚‡ใ", "stem": "ใ€Œ้ƒตไพฟๅฑ€ใ€ใงใใฃใฆใ‚’่ฒท(ใ‹)ใ„ใพใ™ใ€‚"}
{"key": "ใ‚’", "stem": "ใ™ใฟใพใ›ใ‚“ใ€‚ใงใ‚“ใ‚ใฐใ‚“ใ”ใ†๏ผˆ ๏ผ‰ใพใกใŒใˆใพใ—ใŸใ€‚"}
{"options": {"A": "้‹ญใŽ", "C": "่„ฑใŽ", "B": "็จŽใŽ", "D": "่„‚ใŽ"}, "key": "C. ่„ฑใŽ", "stem": "้ดใ‚’ใ€ŒใฌใŽใ€ใชใ•ใ„ใ€‚"}
{"options": {"A": "ใฎ,ใง", "C": "ใฎ,ใซ", "B": "ใจ,ใง", "D": "ใจ,ใซ"}, "key": "D. ใจ,ใซ", "stem": "ใใ‚‡ใ†ใ—ใคใฏไธ€ใ‹ใ„๏ผˆ ๏ผ‰ไบŒใ‹ใ„๏ผˆ ๏ผ‰ใ‚ใ‚Šใพใ™ใ€‚"}
{"options": {"A": "ใใค", "C": "ใ‹ใฐใ‚“", "B": "ใ‚ใ—", "D": "ใšใผใ‚“"}, "key": "A. ใใค", "stem": "ใ€Œ้ดใ€ใ‚’ใฏใใพใ™ใ€‚"}
{"options": {"A": "ใ‹ใ‚‰", "C": "ใ ใ‘", "B": "ใซ", "D": "ใŒ"}, "key": "A. ใ‹ใ‚‰", "stem": "ใ˜ใ‚…ใŽใ‚‡ใ†ใฏ10ใ˜๏ผˆ ๏ผ‰ใงใ™ใ€‚"}
{"options": {"A": "ใ‚ˆใ‚Š", "C": "ใ—ใ‹", "B": "ใฏ", "D": "ใใ‚‰ใ„"}, "key": "A. ใ‚ˆใ‚Š", "stem": "ใƒฉใƒผใƒกใƒณ๏ผˆ ๏ผ‰ใ”ใฏใ‚“ใฎใปใ†ใŒใ™ใใงใ™ใ€‚"}
@vu3jej
vu3jej / classify.py
Created May 4, 2017 05:31 — forked from bwbaugh/classify.py
Detecting a Specific Watermark in a Photo with Python Get example training and testing images here: <http://bwbaugh.com/stack-overflow/16222178_watermark.tar> Stack Overflow question: <http://stackoverflow.com/questions/16222178/detecting-a-specific-watermark-in-a-photo-with-python-without-scipy>
# Copyright (C) 2013 Wesley Baugh
"""Tools for text classification.
Extracted from the [infer](https://github.com/bwbaugh/infer) library.
"""
from __future__ import division
import math
from collections import defaultdict, namedtuple, Counter
from fractions import Fraction
@vu3jej
vu3jej / colour_extractor.py
Last active March 29, 2023 23:55
COLOUR NAME EXTRACTION USING SPACY
import spacy
class ColourExtractorStrict:
"""Extract colours along with adjectives"""
def __init__(self, colours):
self.colours = colours
self.pos_ok = ['ADJ', 'NOUN']
self.tagger = spacy.load('en')
@vu3jej
vu3jej / slytherin.py
Created September 21, 2016 15:23
camelCase ==> snake_case
def slytherin(string):
"""Convert & return strings in camelCase to snake_case"""
tmp = re.sub(pattern=r'(.)([A-Z][a-z]+)', repl=r'\1_\2', string=string)
return re.sub(pattern=r'([a-z0-9])([A-Z])', repl=r'\1_\2', string=tmp)\
.lower()
@vu3jej
vu3jej / print_zip_file_count.sh
Last active August 4, 2016 12:37
Bash one-liner to print the filename, compressed size, compression factor and ZIP archive name of all the zipped files in a directory
for file in $(find . -type f -print); do zipinfo -m "$file" | awk -v filename="$file" -F ' ' '{ print $4, "\t", $6, "\t", $10, "\t", filename }'; done;
@vu3jej
vu3jej / print_immediate_parent_dir.sh
Created August 4, 2016 08:05
Print immediate parent directory along with filename and the file size
#!/bin/bash
for filename in $(find . -type f -print)
do
du_out=$(du -s $filename)
splitted=($(echo ${du_out}))
size="${splitted[0]}"
abs_path="${splitted[1]}"
parent_dir=$(basename $(dirname "$abs_path"))
filename=$(basename "$abs_path")