Skip to content

Instantly share code, notes, and snippets.

Marc Abramowitz msabramo

Block or report user

Report or block msabramo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
msabramo / restart-adobe-bridge.applescript
Created Aug 22, 2019
Restart Adobe Bridge 2019 with AppleScript
View restart-adobe-bridge.applescript
#!/usr/bin/env osascript
set appName to "Adobe Bridge 2019"
tell application appName to quit
tell application "System Events"
if appName is not in (name of application processes) then exit repeat
end tell
do shell script "sleep 0.5"
end repeat
msabramo / Dockerfile
Created Jul 26, 2019
Cypress test Dockerfile
View Dockerfile
# use Cypress provided image with all dependencies included
FROM cypress/base:10
RUN node --version
RUN npm --version
RUN apt-get update && \
apt-get install -y locales && \
sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && \
View cypress-verify-error.txt
2019-07-26T20:42:53.235Z cypress:cli installing Cypress from NPM
2019-07-26T20:42:53.489Z cypress:cli installing with options {}
2019-07-26T20:42:53.490Z cypress:cli version in package.json is 3.4.0
2019-07-26T20:42:53.494Z cypress:cli Reading binary package.json from: /root/.cache/Cypress/3.4.0/Cypress/resources/app/package.json
2019-07-26T20:42:53.496Z cypress:cli no binary installed under cli version
2019-07-26T20:42:53.497Z cypress:cli checking local file /usr/src/app/3.4.0 cwd /usr/src/app/node_modules/cypress
2019-07-26T20:42:53.497Z cypress:cli preparing to download and unzip version 3.4.0 to path /root/.cache/Cypress/3.4.0
Installing Cypress (version: 3.4.0)
[?25l[20:42:53] Downloading Cypress [started]
msabramo / files_from_fixtures_in_cypress.js
Last active Mar 7, 2019
Trying to get File objects from fixtures in
View files_from_fixtures_in_cypress.js
function getFile(f) {
return new Cypress.Promise((resolve, reject) => {
return cy.fixture(f).then((img) => {
const file = makeFile({
name: f,
dataURL: `data:image/${f.slice(f.length - 3)};base64,${img}`,
msabramo / swagger.yaml
Last active Aug 23, 2018
Toy swagger file
View swagger.yaml
openapi: 3.0.0
title: Sample API
description: Optional multiline or single-line description in [CommonMark]( or HTML.
version: 0.1.9
- url:
description: Optional server description, e.g. Main (production) server
- url:
description: Optional server description, e.g. Internal staging server for testing
msabramo /
Created Feb 22, 2018
A sample
from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
# def on_start(self):
# """ on_start is called when a Locust start before any task is scheduled """
# self.login()
def index(self):
msabramo / get-serial-number.exp
Created Sep 30, 2017
Script to get the serial number of a Mac OS computer
View get-serial-number.exp
#!/usr/bin/expect -f
# Script to get the serial number of a Mac
set timeout 10
log_user 0
spawn /bin/sh -c "ioreg -rac IOPlatformExpertDevice | xpath 'plist/array/dict/key\[.=\"IOPlatformSerialNumber\"\]/following-sibling::*\[position()=1\]/text()' 2>/dev/null"
expect eof
set serial $expect_out(buffer)
puts $serial
msabramo /
Created Jul 8, 2016
Proving my identity for

Keybase proof

I hereby claim:

  • I am msabramo on github.
  • I am msabramo ( on keybase.
  • I have a public key ASAlHNkORhOLjfgneM_MPvQgkgP-7nodqWEmFfgrpL85tQo

To claim this, I am signing this object:

msabramo /
Created Sep 11, 2015
Mock patch multiple targets in Python
def multiple_targets(mock_patches):
`mock_patches` is a list (or iterable) of mock.patch objects
Example usage:
with mock.patch.multiple_targets([
mock.patch('os.path.exists', side_effect=mock_path_exists),
msabramo /
Created Sep 11, 2015
A Python context manager for doing multiple mock.patches
def multiple_mocks(mock_specs):
`mock_specs` is a dict of mock target name => mock patch kwargs
Example usage:
with multiple_mocks(
{'os.path.exists': {'side_effect': mock_path_exists},
'subprocess.Popen': {},
You can’t perform that action at this time.