This file contains hidden or 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 Foundation | |
| import UIKit | |
| extension UIColor { | |
| convenience init(hexString:String) { | |
| let hexString:NSString = hexString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) | |
| let scanner = NSScanner(string: hexString) | |
| if (hexString.hasPrefix("#")) { | |
| scanner.scanLocation = 1 |
This file contains hidden or 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
| After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
| The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
| Database files have to be updated before starting the server, here are the steps that had to be followed: | |
| # need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
| brew unlink postgresql | |
| brew install postgresql@9.6 | |
| brew unlink postgresql@9.6 | |
| brew link postgresql |
This file contains hidden or 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 requests | |
| import time | |
| import json | |
| arr = [] | |
| end_cursor = '' # empty for the 1st page | |
| tag = 'russia' # your tag | |
| page_count = 5 # desired number of pages | |
| for i in range(0, page_count): | |
| url = "https://www.instagram.com/explore/tags/{0}/?__a=1&max_id={1}".format(tag, end_cursor) | |
| r = requests.get(url) |
This file contains hidden or 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 base64 | |
| import struct | |
| import datetime | |
| import binascii | |
| from urllib.parse import quote_plus | |
| # pip install pycryptodomex | |
| from Cryptodome import Random | |
| from Cryptodome.Cipher import AES |
OlderNewer