Skip to content

Instantly share code, notes, and snippets.

View xVir's full-sized avatar

Danil Skachkov xVir

  • Google
  • Santa Clara
View GitHub Profile
@xVir
xVir / src.js
Created August 4, 2016 06:38
Get user id in FB API.AI bot
let apiaiRequest = apiAiService.textRequest(text,
{
sessionId: sessionIds.get(sender),
contexts: [
{
name: "generic",
parameters: {
facebook_user_id: sender
}
}
@xVir
xVir / updated_copy_path.md
Last active August 16, 2016 06:51
updated_copy_path

It is the updated variant of my copy path script for Automator

on run {input, parameters}
	set res to ""
	if not input = "" then
		repeat with theFile in input
			if not res = "" then
				set res to res & return
 end if
@xVir
xVir / vpn.md
Created August 29, 2016 07:16
Scripts for enabling and disabling VPN in Control Plane

This script will be usefull if you want to enable VPN automatically on coming to work and to disable it on escaping from work using great Control Plane app.

It is assumed that you use Tunnelblick to manage VPN connections.

To connect to VPN:

set q to "<your_connection_name>"
tell application "Tunnelblick"
	set configs to get name of configurations
	if q is in configs then