This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License: MIT, feel free to use it! | |
const Intercom = require('intercom-client'); | |
const appId = 'APP_ID' | |
const apiKey = 'APP_KEY' | |
const client = new Intercom.Client(appId, apiKey); | |
const async = require('async-q') | |
//REF: https://developers.intercom.com/reference#iterating-over-all-users | |
//WARNING: you can only have one scroll working at once. you need to wait for that scroll to clear to try again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"aws_access_key": "", | |
"aws_secret_keu": "" | |
}, | |
"builders": [{ | |
"type": "amazon-ebs", | |
"access_key": "{{user `aws_access_key`}}", | |
"secret_key": "{{user `aws_secret_key`}}", | |
"region": "us-east-1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE SYNONYM first_link FOR second_link; | |
CREATE SYNONYM second_link FOR third_link; | |
CREATE TABLE third_link (a INT); | |
-- Msg 470, Level 16, State 1, Line 7 | |
-- The synonym "first_link" referenced synonym "second_link". Synonym chaining is not allowed. | |
SELECT * | |
FROM first_link; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# T-SQL doesn't support the INTERSECT ALL operator. | |
# This gets you close. | |
# It only returns just one copy of each duplicate. | |
# GROUP BY * is not valid syntax so you have to write all the column names out. | |
SELECT * | |
FROM ( | |
SELECT * | |
FROM #HasDupes | |
UNION ALL | |
SELECT DISTINCT * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@('iain', 'admin_iain') | | |
% { | |
$id = $_ | |
(Get-ADPrincipalGroupMembership -Identity $id | Select -ExpandProperty name) | | |
% { | |
@{ $id = $_ } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import requests_cache | |
from urlparse import urlparse | |
from os.path import basename | |
def dump_cache(): | |
""" | |
Writes all the responses in the cache to files. | |
The filename is the basename of the URL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import requests_cache | |
from urlparse import urlparse | |
from os.path import basename | |
from pprint import pprint | |
# By default requests uses urlib3 | |
# <class 'requests.packages.urllib3.response.HTTPResponse'> | |
resp = requests.get('http://httpbin.org/user-agent') | |
print type(resp.raw) |