Skip to content

Instantly share code, notes, and snippets.

View jsmithdev's full-sized avatar
🏗️
building things

Jamie Smith jsmithdev

🏗️
building things
View GitHub Profile
@jsmithdev
jsmithdev / sfdx-cheatsheet.sh
Created February 22, 2019 19:54 — forked from xixiaofinland/sfdx-cheatsheet.sh
Salesforce SFDX Cheat Sheet
# This cheatsheet contains the most often used SFDX commands for beginners to get a jumpstart.
# Hint. it is highly recommended to use `-h` to check the usage of any SFDX commands and corresponding parameters.
# For instance, use `sfdx force:auth:web:login -h` to checke what `-d` `-a` parameters do
# List down all supported dx commands:
sfdx force:doc:commands:list
# Check current DebHub and Scratch Org status
sfdx force:org:list
@jsmithdev
jsmithdev / Simple Node Gulpfile.js
Last active December 13, 2018 01:18 — forked from webdesserts/Gulpfile.js
Revised for Gulp v4: Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
// jshint esversion: 6, asi: true, laxcomma: true
const gulp = require('gulp')
, spawn = require('child_process').spawn
, killer = node => node ? node.kill() : null
, config = {
init: ['index.js'],
watch: ['*.js']
}
;
@jsmithdev
jsmithdev / fiddle.html
Created March 11, 2018 05:00 — forked from anonymous/fiddle.html
Modern WebRTC remote call w/chat (source: https://jsfiddle.net/jamiesmith/Lcpk143y/)
<video id="video1" height="120" width="160" autoplay muted></video>
<video id="video2" height="120" width="160" autoplay></video>
<br>
<button id="button" onclick="createOffer()">Offer:</button>
<textarea id="offer" placeholder="Paste offer here"></textarea>
<br>
@jsmithdev
jsmithdev / firebase_detect_data.js
Created April 14, 2017 14:30 — forked from anantn/firebase_detect_data.js
Firebase: Detecting if data exists. This snippet detects if a user ID is already taken
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');
<html>
<head>
<title>API Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var accessToken = "<your agent's client access token>";
var baseUrl = "https://api.api.ai/v1/";