Skip to content

Instantly share code, notes, and snippets.

View vukanac's full-sized avatar
🎯
Focusing

Vladimir Vukanac vukanac

🎯
Focusing
View GitHub Profile
@vukanac
vukanac / xslx_to_csv.js
Created July 26, 2017 08:32
Read Excel file and save every worksheet as CSV file.
var filename = `${__dirname}/../server/data/sample.xlsx`;
// Read from a file give path to Excel/xlsx file.
var workbook = new Excel.Workbook();
workbook.xlsx
.readFile(filename)
.then(function() {
console.log('Loaded!');
// Write to a file.
// use workbook
@vukanac
vukanac / install-php72-osx.md
Created August 20, 2017 19:26
How to install php72 on Mac OS X with homebrew.

Skip this:

brew tap homebrew/dupes
brew tap homebrew/versions

As:

Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
@vukanac
vukanac / install-node8-mac-osx.md
Last active August 31, 2018 17:28
How to install node8 on mac osx 2017-08-20.

How to install node8 on mac osx

At an absolute minimum, you need to go into the home directories (the ones that start with ~/) and make sure you are okay with deleting the contents of those directories. If you are unsure if this will delete anything important, you should stop now and find another alternative for re-installing Node.js, because this approach is pretty destructive.

it('should refuse partial submissions', function(done) {
var browser = this.browser;
browser.fill('first_name', 'John');
browser.pressButton('Send').then(function() {
assert.ok(browser.success);
assert.equal(browser.text('h1'), 'Contact');
assert.equal(browser.text('div.alert'), 'Please fill in all the fields');
}).then(done, done);
});
@vukanac
vukanac / osx_bootstrap.sh
Created March 26, 2019 08:11 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@vukanac
vukanac / mfa-login.py
Created March 28, 2020 12:56
AWS Command Line MFA Login
#!/usr/bin/env python3
import dateutil.parser, dateutil.tz, datetime, json, os, sys, boto3, stat
from subprocess import Popen, PIPE
# Get the profile, first argument on the command line
if (len(sys.argv) < 2):
raise Exception('Profile name not specified on command line')
profile = sys.argv[1]
@vukanac
vukanac / authorize.ex
Created April 16, 2020 12:10 — forked from jeremytregunna/authorize.ex
After refactoring...
defmodule Api.Authorize do
alias Account.Models.User
alias Tracker.OrganizationMembers, as: OM
def board?(board_id, %User{} = user, available_perms, required_perms) do
with(
{:ok, board} <- Tracker.Board.find(board_id),
true <- OM.user_in_organization?(user.id, board.organization_id)
) do
required_perms == common_permissions(required_perms, available_perms)