When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)
Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories
Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.
Save that list to some path
The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.
import asyncio | |
import psycopg2 | |
# dbname should be the same for the notifying process | |
conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example") | |
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
cursor = conn.cursor() | |
cursor.execute(f"LISTEN match_updates;") |
# Command Line to run from terminal | |
# Logs result to file s3_backup.log | |
# Command will run in the background | |
s3cmd sync -v /path/to/folder/ s3://s3-bucket/folder/ > s3_backup.log 2>&1 & | |
# Crontab command to sync folder to S3 | |
# Command will run 1am every day and logs result to /root/s3_backup.log | |
0 1 * * * /usr/bin/s3cmd sync -rv /path/to/folder/ s3://s3-bucket/folder/ >> /root/s3_backup.log |
If you need to access/manage files stored on Amazon S3 bucket via SFTP, you can mount the bucket to a file system on a Linux server and access the files using the SFTP as any other files on the server. | |
Creating Access Server | |
Launch a new Amazon EC2 server. A basic Amazon Linux AMI (free tier eligible) server will generally suffice and the following instructions are tested on this distribution. Instructions for other distributions may differ. | |
To install the s3fs file system | |
- Login to your Linux server via SSH. |
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'open-uri' | |
require 'json' | |
require 'csv' | |
options = {} | |
ARGV << '-h' if ARGV.empty? | |
OptionParser.new do |opts| |
@IBOutlet weak var qrCodeBox: UIImageView! | |
func createQRFromString(_ str: String, size: CGSize) -> UIImage { | |
let stringData = str.data(using: .utf8) | |
let qrFilter = CIFilter(name: "CIQRCodeGenerator")! | |
qrFilter.setValue(stringData, forKey: "inputMessage") | |
qrFilter.setValue("H", forKey: "inputCorrectionLevel") | |
let minimalQRimage = qrFilter.outputImage! |
import java.io.*; | |
import java.util.*; | |
import java.text.*; | |
public class ArrayMerge { | |
public static int[] merge(int[] A, int[] B) { | |
int i, j, k, m, n; | |
i = 0; | |
j = 0; |
module GPS | |
class Distance | |
RAD_PER_DEG = Math::PI / 180 | |
GREAT_CIRCLE_RADIUS_MILES = 3956 | |
GREAT_CIRCLE_RADIUS_KILOMETERS = 6371 # some algorithms use 6367 | |
GREAT_CIRCLE_RADIUS_FEET = GREAT_CIRCLE_RADIUS_MILES * 5280 | |
GREAT_CIRCLE_RADIUS_METERS = GREAT_CIRCLE_RADIUS_KILOMETERS * 1000 | |
GREAT_CIRCLE_RADIUS_NAUTICAL_MILES = GREAT_CIRCLE_RADIUS_MILES / 1.15078 | |
attr_accessor :great_circle_distance |