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
on alfred_script() | |
tell application "Finder" | |
eject disk "media" | |
end tell | |
end alfred_script |
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
on alfred_script() | |
tell application "Finder" | |
open location "smb://192.168.1.101/media" | |
end tell | |
end alfred_script |
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
//: Playground - noun: a place where people can play | |
import Foundation | |
var path = "/abc/def ghi/jkg\\ lmn/opq" | |
let reEscapedSpaces = "^.*\\\\ .*$" // simple | |
let reUnescapedSpaces = "^.*(?<!\\\\) .*$". // negative look-behind | |
if path.range(of: reUnescapedSpaces, options: .regularExpression) != nil { |
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
#!/usr/bin/python | |
""" | |
Installation: Get the *Miniconda* Python Distribution - not the Python distrubution from python.org! | |
- https://conda.io/miniconda.html | |
Then install modules: | |
- `cd ~/miniconda3/bin` | |
- `./conda install numpy pandas matplotlib` |
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
#!/usr/local/bin/python3 | |
import http.client | |
def get_all_headers(host, port, url, connection='https'): | |
""" | |
This can be used to test if your web server leaks any info it should rather keep for itself | |
Examples: |
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 React from "react" | |
export default class CountryFlag extends React.PureComponent { | |
constructor(props) { | |
super(props) | |
this.state = { | |
countryCode: props.countryCode ? props.countryCode : "???", | |
fontSize: props.fontSize ? props.fontSize : 24 | |
} |
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
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
from github3 import login | |
# https://github3.readthedocs.io/en/latest/index.html#more-examples | |
def enter_2fa_code(): | |
# Source: https://github3.readthedocs.io/en/latest/examples/two_factor_auth.html |
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
#! /usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
import datetime | |
import json | |
from urllib.parse import urlencode | |
from urllib.request import Request, urlopen | |
class DockerImageInfo(object): |
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
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Documentation: | |
- Docker Engine API: https://docs.docker.com/develop/sdk/ | |
- Docker SDK for Python: https://docker-py.readthedocs.io/en/stable/ | |
""" | |
import docker |
OlderNewer