Skip to content

Instantly share code, notes, and snippets.

@xtream1101
xtream1101 / sublime.sh
Created November 25, 2017 05:25
Auto create and open sublime projects
sublime_project_template='{
"folders":
[
{
"path": "."
}
],
"file_exclude_patterns":[
"*.sublime-*"
]
"""Sort a list of dicts using multiple keys
Also be able to have the different keys sort in different orders
"""
from pprint import pprint
unsorted_data_a = [{'title': 'Foo Beta',
'date': '2018-06-03',
'value': 5},
@xtream1101
xtream1101 / getty.py
Last active October 3, 2018 16:01
Quick example on how to download videos off getty images using only requests
import logging
import requests
import urllib
import urllib.parse
from parsel import Selector
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
@xtream1101
xtream1101 / instacart_scraper.py
Last active January 31, 2022 03:21
Instacart scraper
import json
import time
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from webdriverdownloader import GeckoDriverDownloader
@xtream1101
xtream1101 / Backup&RestoreRepo.md
Created June 29, 2019 12:38
Backup and restore a git repo using git bundle

Backup/archive a repo

  1. Clone the repo
git clone --mirror https://github.com/vuejs/vue
  1. cd into the cloned repo
  2. Create a bundle file in the parent directory
git bundle create ../vuejs_vue.bundle --all