Skip to content

Instantly share code, notes, and snippets.

View cassvail's full-sized avatar

Cassiano Vailati cassvail

View GitHub Profile
@cassvail
cassvail / New iTerm Here.workflow
Created September 20, 2017 12:23
MacOS AppleScript Service to open iTerm in current folder
--- file path: {user_home}/Library/Services
--- MacOS AppleScript Service to open iTerm in current folder
--- Service receives: no input
--- in: Finder.application
on run
tell application "Finder"
activate
try
set this_folder to (the target of the front window) as alias
@cassvail
cassvail / New File.workflow
Created September 20, 2017 12:21
MacOS AppleScript Service to create new file
--- file path: {user_home}/Library/Services
--- MacOS AppleScript Service to create new file
--- Service receives: no input
--- in: Finder.application
set file_name to "untitled"
set file_ext to ""
set is_desktop to false
-- get folder path and if we're in desktop (no folder opened)
@cassvail
cassvail / Move To.workflow
Created September 20, 2017 12:19
MacOS AppleScript Service to move file to folder
--- file path: {user_home}/Library/Services
--- MacOS AppleScript Service to move file to folder
--- Service receives: no input
--- in: Finder.application
tell application "Finder"
set mvfiles to selection
set destFolderPath to choose folder
set destFolder to name of destFolderPath
set destFolder to destFolderPath as string
@cassvail
cassvail / Copy current path.workflow
Created September 20, 2017 12:18
MacOS AppleScript Service to copy current file path to clipboard
--- file path: {user_home}/Library/Services
--- MacOS AppleScript Service to copy current file path to clipboard
--- Service receives: no input
--- in: Finder.application
tell application "Finder"
set pathFile to selection as text
set pathFile to get POSIX path of pathFile
set the clipboard to pathFile
end tell
const xs = require('xstream').default
const axios = require('axios')
xs.periodic(1000).map(() => {
return xs.fromPromise(axios.get('https://sample.domain'))
}).flatten()
.subscribe({
next: (response) => {
console.log(response)
}
const Rx = require('rxjs')
const axios = require('axios')
Rx.Observable.interval(1000)
.switchMap(() => {
return axios.get('https://sample.domain')
})
.subscribe((response) => {
console.log(response)
})
<?php
/**
* Class to test Db2 SQL Engine
* Tests use static setUpBeforeClass and tearDownAfterClass because setUp and tearDown
* have problems recreating the test library
*/
class DB2iSeriesSQLEngineTest extends PHPUnit_Framework_TestCase
{
protected static $dbUsername = "USERNAME";
@cassvail
cassvail / automator_new_file.scpt
Created November 12, 2015 11:21 — forked from rarylson/automator_new_file.scpt
AppleScript to create a new file in Finder (to be used in Automator)
-- AppleScript to create a new file in Finder
--
-- Use it in Automator, with the following configuration:
-- - Service receives: no input
-- - In: Finder.app
--
-- References:
-- - http://apple.stackexchange.com/a/129702
-- - http://stackoverflow.com/a/6125252/2530295
-- - http://www.russellbeattie.com/blog/fun-with-the-os-x-finder-and-applescript