You can hook into authentication success by passing an authentication_callback
to the client.
If you're happy relying on an internal API call, you can make sure your token is fresh by calling:
restforce_client.authenticate!
# Usage: ruby verify-ssl.rb domain1.com domain2.com domain3.com | |
require 'socket' | |
require 'openssl' | |
SSL_PORT = 443 | |
def verify(domain, cert_store) | |
puts "---" | |
puts "Domain: #{domain}" |
require 'digest/md5' | |
# This demonstrates an approach you can use to deterministically generate fake | |
# data based on user data to anonymize it. | |
# An array of substitute names read from a file | |
substitute_names = File.read('names.txt').split("\n") | |
# Real customer data, e.g., from a database | |
real_name = "John Realname" |
require 'digest/md5' | |
# This demonstrates an approach you can use to deterministically generate fake | |
# data based on user data to anonymize it. | |
# An array of substitute names read from a file | |
substitute_names = File.read('names.txt').split("\n") | |
# Real customer data, e.g., from a database | |
real_name = "John Realname" |
#!/usr/bin/env ruby | |
begin | |
require 'plist' | |
rescue LoadError | |
abort "Missing dependency. Please run: `gem install plist` and try again." | |
end | |
raw_output = `system_profiler SPApplicationsDataType -xml -detailLevel mini` |
3.1.1 Limit system access to authorized users, processes acting on behalf of authorized users, and devices (including other systems).
3.1.2 Limit system access to the types of transactions and functions that authorized users are permitted to execute.
#!/bin/bash | |
match_pattern=".only" | |
file_pattern="*.js" | |
# Exit if any command fails | |
set -e | |
function matching_diff { | |
git diff --staged -G "$match_pattern" $@ -- $file_pattern |
const { createNamespace } = require('continuation-local-storage') | |
const createUUID = require('uuid/v1') | |
// Application | |
const logger = require('./logger') | |
const performSomeProcessing = require('./processing') | |
// Establish a new storage area for the continuation | |
const context = createNamespace('context') |
require 'thread' | |
def thing_yielder(&block) | |
things = %i( a b c ) | |
yieldings = Queue.new | |
threads = things.map do |thing| | |
Thread.new do | |
sleep rand(1..3) # Simulate work | |
yieldings << thing |