Skip to content

Instantly share code, notes, and snippets.

View Black-Milk's full-sized avatar
🐇
It’s turtles all the way down…

Edwin M. Black-Milk

🐇
It’s turtles all the way down…
View GitHub Profile
@Black-Milk
Black-Milk / postgres_html_remover.sql
Created August 2, 2024 12:25
Postgres HTML Tag Remover
CREATE OR REPLACE FUNCTION REMOVE_HTML_TAGS(TEXT) RETURNS TEXT AS
$$
DECLARE
INPUT_TEXT ALIAS FOR $1;
CLEAN_TEXT TEXT;
BEGIN
-- Remove Tags (e.g. <p>, <a>, <div>)
CLEAN_TEXT := REGEXP_REPLACE(INPUT_TEXT, '<[^>]+>', '', 'g');
-- Remove entities (e.g. &nbsp;)
@Black-Milk
Black-Milk / install_linux_gcc_48.sh
Created November 7, 2019 03:52
Install GCC 4.8 for Linux without Root
#!/bin/bash
INSTALL_PATH=<your_local_install_path_goes_here>
curl -LO https://mirrors.kernel.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.bz2
tar xf gcc-4.8.5.tar.bz2
mkdir build
@Black-Milk
Black-Milk / emoji_lookup.R
Created March 9, 2017 22:02
Emoticon Lookup Table in R
library(rvest)
library(magrittr)
library(dplyr)
# reference website
url <- "http://apps.timwhitlock.info/emoji/tables/unicode"
#List of table selectors
table_css_selectors <- list('body > div.container > div > div > table:nth-child(7)', #emoticons
'body > div.container > div > div > table:nth-child(17)', #additional_emoticons
@Black-Milk
Black-Milk / Sublime Text Alias for shell configuration
Created March 6, 2014 04:08
Add this to your shell configuration file to open files with sublime text.
alias sublime="open -a /Applications/Sublime\ Text.app"
@Black-Milk
Black-Milk / Main.sublime-menu
Last active October 22, 2018 11:51
Sublime REPL settings for Anaconda distribution of Python. Included are REPL settings for python and ipython running under python 2.7 and python 3.3. Be sure to provide the appropriate path to your Anaconda Python 2.7 and Python 3.3 executables within the lines that start with "cmd" .
[
{
"id": "tools",
"children":
[{
"caption": "SublimeREPL",
"mnemonic": "r",
"id": "SublimeREPL",
"children":
[
@Black-Milk
Black-Milk / Perl.sublime-build
Created March 5, 2014 05:18
This is a build file for PERL. Be sure to have perl installed on your system. If you're using a distribution provided by a third party, make sure to have it's directory appended to your PATH.
{
"cmd": ["perl", "-w", "$file"],
"file_regex": ".* at (.*) line ([0-9]*)",
"selector": "source.perl"
}
@Black-Milk
Black-Milk / python 3(Anaconda).sublime-build
Created March 5, 2014 05:14
Python 3.3 Anaconda build file for sublime text 3. Be sure to replace //anaconda/envs/py3k/bin/python3.3 with the actual path including the python 3 unix executable provided by your Anaconda distribution (assuming you've already installed it...).
{
"cmd": ["//anaconda/envs/py3k/bin/python3.3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
@Black-Milk
Black-Milk / python 2.7(Anaconda).sublime-build
Created March 5, 2014 05:08
Replace //anaconda/bin/python2.7 with the actual path of your anaconda python distribution and you should be good to go.
{
"cmd": ["//anaconda/bin/python2.7", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}