To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
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 |
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) |
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 [email protected] | |
brew unlink [email protected] | |
brew link postgresql |
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 |
var util = require('util'); | |
var dgram = require('dgram'); | |
function logstashUDP(host, port, type, message, fields, callback) { | |
var client = dgram.createSocket('udp4'); | |
var logObject = { | |
'@timestamp': (new Date).toISOString(), | |
type: type, | |
message: message, | |
fields: fields |
-module(web_lager_handler). | |
-behaviour(gen_event). | |
-export([subscribe/1, unsubscribe/1]). | |
-export([init/1, handle_call/2, handle_event/2, handle_info/2, terminate/2, | |
code_change/3]). | |
-export([remover_loop/0]). |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
-module(json_parser). | |
-export([decode_api/1]). | |
-record(api, { | |
status, | |
message, | |
timeout | |
}). | |
-record(api1, { |
#!/usr/bin/env python | |
# | |
# Copyright 2012 Patrick Hetu <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |