Skip to content

Instantly share code, notes, and snippets.

try {
// Make your Google API call
} catch (GoogleJsonResponseException e) {
GoogleJsonError error = e.getDetails();
// Print out the message and errors
}
@ikai
ikai / searchByKeyword.gs
Last active February 9, 2017 04:07
Search by keyword sample for the YouTube API for Google Apps Script.
function searchByKeyword() {
var results = YouTube.Search.list("id,snippet",
{q : "google apps script", maxResults: 25});
for(var i in results.items) {
var item = results.items[i];
Logger.log("[%s] Title: %s", item.id.videoId, item.snippet.title);
}
}
$ whois getcoupons.pw
Domain ID:CNIC-DO2751397
Domain Name:GETCOUPONS.PW
Created On:2014-05-20T18:54:45.0Z
Last Updated On:2014-05-25T18:57:08.0Z
Expiration Date:2015-05-20T23:59:59.0Z
Status:clientTransferProhibited
Status:serverTransferProhibited
Registrant ID:L24FVEUTOVCIHDJM
Registrant Name:WhoisGuard Protected
@ikai
ikai / subprocess_cmd_args.py
Created August 6, 2015 20:13
Shows how to print the exact string subprocess is using from a list
cmd_args = ['cat', 'somefile.txt']
print subprocess.list2cmdline(cmd_args)
@ikai
ikai / slack_example.py
Created October 7, 2015 18:51
Actual working slack example code
from slackclient import SlackClient
# Don't prefix the #
channel_name = 'apitest'
# Your API key is actually found at https://api.slack.com/web
token = 'your API key'
sc = SlackClient(token)
sc.rtm_connect()
@ikai
ikai / boto3_rds_example.py
Created November 19, 2015 01:37
Simplest boto3 example for creating an RDS PostgreSQL instance
import time
import boto3
import botocore
def main():
db_identifier = 'yourDBID'
rds = boto3.client('rds')
try:
@ikai
ikai / 0_reuse_code.js
Created September 27, 2016 19:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console