Skip to content

Instantly share code, notes, and snippets.


Edison A edison12a

  • Singalarity
  • Remote
View GitHub Profile
edison12a /
Created Aug 10, 2021 — forked from tomysmile/
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
iterates over files in a directory, finds photos and compares them for similarity
if 2 photos are similar, the duplicate is deleted
from PIL import Image
import imagehash
import os
import time
edison12a / linkedin_ignore.js
Created Jun 30, 2021
Delete all pending connections on Linked in
View linkedin_ignore.js
var aTags = document.getElementsByTagName("span");
var searchText = "Ignore";
var found;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent.includes(searchText)) {
found = aTags[i];;
} else {
// console.log(aTags[i].textContent)
edison12a /
Created Sep 5, 2019
Flatten a nested dictionary in python
def flatten(nested, column_names):
all_dicts = []
final_result = {}
index = 0
def recurse(data):
for k, v in data.items():
final_result = {}
if isinstance(v, dict):


When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
View sample.js
// doing check when array is empty produces non stopping loop
// add database
var express = require('express');
var mongoose = require('mongoose');
var bodyParser = require('body-parser');
var json2html = require('node-json2html');
var app = express();
# if you want to pull data from an API, requests is your friend
import requests
# BeautifulSoup helps us extract data from html, xml, ..
from bs4 import BeautifulSoup
# this is the type of strings extracted from html
from bs4.element import NavigableString
ug_results = []
# set these to a big number like 1000, 10000, any number that makes sense as an index number
edison12a /
Created Apr 26, 2018 — forked from yoander/
Python script to pretty print XML files
import os
import re
import HTMLParser as parser
import xml.dom.minidom as minidom
import sys
# Read de file name from standard input
filename = sys.argv[1]
edison12a /
Created Apr 3, 2018 — forked from bradmontgomery/
A way to remove all HTML attributes with BeautifulSoup
from BeautifulSoup import BeautifulSoup
def _remove_attrs(soup):
for tag in soup.findAll(True):
tag.attrs = None
return soup
def example():
doc = '<html><head><title>test</title></head><body id="foo" onload="whatever"><p class="whatever">junk</p><div style="background: yellow;" id="foo" class="blah">blah</div></body></html>'