Skip to content

Instantly share code, notes, and snippets.


Thomas Stachl tstachl

View GitHub Profile
tstachl / Gemfile
Created Jan 15, 2014
Export knowledge base articles from and zip them up for a import.
View Gemfile
source ''
ruby '2.0.0'
gem 'desk_api', '0.5.0'
gem 'rubyzip', '1.1.0'
gem 'open_uri_redirections', '0.1.4'
tstachl /
Created Feb 21, 2018
Steps to install Authy SSH CLI.
# download the code from github
# run the install
sudo bash authy-ssh install /usr/local/bin
# enable it
sudo /usr/local/bin/authy-ssh enable `whoami`
# test it
tstachl /
Created Apr 13, 2013
Example talking to the API from Salesforce (Apex).
public class DeskSample
private static String OAUTH_KEY = 'youroauthkey';
private static String OAUTH_SECRET = 'youroauthsecret';
private static String ACCESS_TOKEN = 'youraccesstoken';
private static String ACCESS_TOKEN_SECRET = 'youraccesstokensecret';
public static String DESK_SITENAME = 'yoursite';
public static Void doRequest()
View create_customer.rb
require 'desk_api'
DeskApi.configure do |config|
config.username = ''
config.password = 'Example1'
config.endpoint = ''
customer = DeskApi.customers.create({
first_name: 'Test',
tstachl /
Created Sep 24, 2013 Multipass script written in python.
from Crypto import Random
from Crypto.Cipher import AES
from datetime import datetime, timedelta
from isodate import datetime_isoformat
import base64
import hashlib
import hmac
import urllib
import json
tstachl / create_scratch_org
Created May 24, 2018
Create a new scratch org for SCMT development.
View create_scratch_org
echo "Creating a new scratch org"
sfdx force:org:create -f config/project-scratch-def.json -a $1 --setdefaultusername --durationdays 30
sfdx scmt:audit:enable -u $1
echo "Pushing source"
sfdx force:source:push -f -u $1
sfdx force:user:permset:assign --permsetname SCMT_Audit -u $1
sfdx force:data:record:update -s User -w "firstname='User'" -v "UserPermissionsKnowledgeUser=true" -u $1
sfdx force:org:open -u $1
tstachl / .eslintrc.json
Last active Apr 24, 2018
Sane default eslintrc close to Salesforce DX.
View .eslintrc.json
"env": {
"browser": true
"parserOptions": {
"ecmaVersion": 5
"globals": {
"$A": true,
"AuraContext": true,
tstachl / docker-compose.yml
Created Feb 21, 2018
File to test Docker Compose.
View docker-compose.yml
version: '3'
image: nginx:alpine
- '80:80'
- '443:443'
restart: always
tstachl / Dockerfile
Created Feb 21, 2018
A custom Dockerfile to copy a config file into the image.
View Dockerfile
FROM nginx:alpine
COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf
tstachl / docker-compose.yml
Created Feb 21, 2018
A compose file containing the logging service via logsprout.
View docker-compose.yml
version: '3'
image: gliderlabs/logspout
- '/var/run/docker.sock:/var/run/docker.sock'
command: "syslog+tls://${PAPERTRAIL_URL}"
restart: always
You can’t perform that action at this time.