Skip to content

Instantly share code, notes, and snippets.

View tstachl's full-sized avatar

Thomas Stachl tstachl

  • Pilina
  • Remote
View GitHub Profile
@tstachl
tstachl / DeskSample.java
Created April 13, 2013 02:07
Example talking to the Desk.com 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()
require 'desk_api'
DeskApi.configure do |config|
config.username = 'user@example.com'
config.password = 'Example1'
config.endpoint = 'https://sample.desk.com'
end
customer = DeskApi.customers.create({
first_name: 'Test',
@tstachl
tstachl / multipass.py
Created September 24, 2013 00:21
desk.com 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
tstachl / create_scratch_org
Created May 24, 2018 23:24
Create a new scratch org for SCMT development.
#!/bin/bash
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
tstachl / .eslintrc.json
Last active April 24, 2018 12:41
Sane default eslintrc close to Salesforce DX.
{
"env": {
"browser": true
},
"parserOptions": {
"ecmaVersion": 5
},
"globals": {
"$A": true,
"AuraContext": true,
@tstachl
tstachl / docker-compose.yml
Created February 21, 2018 01:48
File to test Docker Compose.
version: '3'
services:
nginx:
image: nginx:alpine
ports:
- '80:80'
- '443:443'
restart: always
@tstachl
tstachl / Dockerfile
Created February 21, 2018 03:31
A custom Dockerfile to copy a config file into the image.
FROM nginx:alpine
COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf
@tstachl
tstachl / docker-compose.yml
Created February 21, 2018 02:38
A compose file containing the logging service via logsprout.
version: '3'
services:
logger:
image: gliderlabs/logspout
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
command: "syslog+tls://${PAPERTRAIL_URL}"
restart: always
@tstachl
tstachl / restart_ssh_client.sh
Created February 20, 2018 23:33
After any changes to the SSH configuration the service needs to be restarted.
sudo service ssh restart
@tstachl
tstachl / sshd_config
Last active February 20, 2018 23:21
My sshd_config with Root and Password access diabled.
# /etc/ssh/sshd_config
# ...
# Authentication
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
# ...