This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sortObject(object) { | |
//Thanks > http://whitfin.io/sorting-object-recursively-node-jsjavascript/ | |
if (!object) { | |
return object; | |
} | |
const isArray = object instanceof Array; | |
var sortedObj = {}; | |
if (isArray) { | |
sortedObj = object.map((item) => sortObject(item)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import os | |
import re | |
import requests | |
import urlparse | |
import smtplib | |
from smtplib import SMTP | |
from smtplib import SMTP_SSL | |
from smtplib import SMTPAuthenticationError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import io | |
import logging | |
import mimetypes | |
import os | |
import re | |
import tempfile | |
from xml.dom import minidom | |
from PIL import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CachedChoiceFieldOptionsMixin(object): | |
""" | |
This class speeds up performance of inline foreign-key pickers so we don't have to re-query the options for each item in the list | |
""" | |
cached_choice_fields = [] | |
def formfield_for_dbfield(self, db_field, **kwargs): | |
request = kwargs['request'] | |
formfield = super(CachedChoiceFieldOptionsMixin, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1. Remove the current version and clear app cache | |
sudo apt-get remove salt-minion | |
sudo apt-get clean | |
apt-get autoremove | |
#2. Create script to view all PPAs: | |
#Save as script as listppa.sh: | |
#! /bin/sh | |
# Script to get all the PPA installed on a system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from django.contrib import admin | |
from dal import autocomplete, forward | |
class AdminAutocompleteFormMixin(forms.ModelForm): | |
class Media: | |
js = ('admin/autocomplete/forward.js', | |
'admin/autocomplete/select_admin_autocomplete.js') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Try to get the profile path | |
PROFILE_PATH='' | |
getProfilePath(){ | |
if [[ "$SHELL" == *"zsh"* ]]; then | |
PROFILE_PATH=$HOME/'.zshrc' | |
elif [[ "$SHELL" == *"bash"* ]]; then | |
if [ -f $HOME/.bashrc ]; then | |
PROFILE_PATH=$HOME/'.bashrc' | |
elif [ -f $HOME/.profile ]; then | |
PROFILE_PATH=$HOME/'.profile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
First few bars of Woe Is Me (World's Smallest Violin) from Spongebob Square Pants | |
Requires pitches.h | |
nina@ninalp.com | |
*/ | |
#include "pitches.h" | |
const int speakerPinMelody = 26; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var possibleDateFormats = [ | |
'Updated on 3/25, 9:35PM', | |
'Updated on 03/25, 9:35PM', | |
'Updated 3/25/2020, 9:35PM', | |
'Updated 3/25/2020 at 9:35PM', | |
'Updated 3/25/2020 at 9:35 p.m.', | |
'Updated 3/25 21:35', | |
'updated on 03/25/20 21:35 PM' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Last Updated */ | |
{ | |
"version": "0.6", | |
"reqId": "0", | |
"status": "ok", | |
"sig": "2121529001", | |
"table": { | |
"cols": [ | |
{ | |
"id": "A", |
NewerOlder