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
def convert(sqlContext: SQLContext, filename: String, schema: StructType, tablename: String) { | |
// import text-based table first into a data frame. | |
// make sure to use com.databricks:spark-csv version 1.3+ | |
// which has consistent treatment of empty strings as nulls. | |
val df = sqlContext.read | |
.format("com.databricks.spark.csv") | |
.schema(schema) | |
.option("delimiter","|") | |
.option("nullValue","") | |
.option("treatEmptyValuesAsNulls","true") |
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
// Based on algorithm given at http://wp.me/pWWz3-14 | |
static string Convert15CharTo18CharId(string id) | |
{ | |
if (string.IsNullOrEmpty(id)) throw new ArgumentNullException("id"); | |
if (id.Length == 18) return id; | |
if (id.Length != 15) throw new ArgumentException("Illegal argument length. 15 char string expected.", "id"); | |
var triplet = new List<string> {id.Substring(0, 5), id.Substring(5, 5), id.Substring(10, 5)}; | |
StringBuilder str = new StringBuilder(5); | |
string suffix = string.Empty; |
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
$.ajax({ | |
type: 'POST', // Use POST with X-HTTP-Method-Override or a straight PUT if appropriate. | |
dataType: 'json', // Set datatype - affects Accept header | |
url: "http://example.com/people/1", // A valid URL | |
headers: {"X-HTTP-Method-Override": "PUT"}, // X-HTTP-Method-Override set to PUT. | |
data: '{"name": "Dave"}' // Some data e.g. Valid JSON as a string | |
}); | |
/* Some clients do not support PUT or it’s difficult to send in a PUT request. For these cases, you could POST the request with a request header of X-HTTP-Method-Override set to PUT. What this tells the server is that the intended request is a PUT. Obviously this relies on the API you are accessing making use of the X-HTTP-Method-Override Header.*/ |
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
0-mail.com | |
027168.com | |
0815.su | |
0sg.net | |
10mail.org | |
10minutemail.co.za | |
11mail.com | |
123.com | |
123box.net | |
123india.com |
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
0-00.usa.cc | |
0-mail.com | |
001.igg.biz | |
0039.cf | |
0039.ga | |
0039.gq | |
0039.ml | |
027168.com | |
0317123.cn | |
0815.ru |
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
// Taken from http://developers.marketo.com/blog/restrict-free-email-domains-on-form-fill-out/ | |
// Prepared by Ian Taylor and Murtza Manzur on 9/9/2014 - Modified Dillan Simmons 8/15/17 | |
(function (){ | |
// Please include the email domains you would like to block in this list | |
var invalidDomains = ["@gmail.","@yahoo.","@hotmail.","@live.","@aol.","@outlook.","@test."]; | |
MktoForms2.whenReady(function (form){ | |
form.onValidate(function(){ | |
var email = form.vals().Email; |
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
# -*- coding: utf-8 -*- | |
import os | |
import StringIO | |
import hashlib | |
try: | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
except ImportError: | |
raise ImproperlyConfigured, "Could not load Boto's S3 bindings." |
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
// Dave's AMPScript cheat sheet. | |
// AMPScript is ExactTarget (SFDC Marketing Cloud)'s server side scripting language. | |
// It's a bit of a pig, plus the docs are numerous and the examples aren't contextual. | |
// This assumes you don't need hand holding, and just need to get your head around it. | |
// It's also my reference for the snippets I use all the time (I'm a formatting stickler). | |
// These examples come from microsites I've written - adapt 'em for use elsewhere. | |
// Multi line AMPScript %%[contained within delimiters]%% gets interpreted on the server. |
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
[ | |
{ | |
"slug": "afghanistan", | |
"name": "Afghanistan", | |
"alpha2": "AF", | |
"alpha3": "AFG", | |
"numerical": "004", | |
"iso_3166_2": "ISO 3166-2:AF" | |
}, | |
{ |
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
name | alpha-2 | alpha-3 | country-code | iso_3166-2 | region | sub-region | intermediate-region | region-code | sub-region-code | intermediate-region-code | |
---|---|---|---|---|---|---|---|---|---|---|---|
Afghanistan | AF | AFG | 004 | ISO 3166-2:AF | Asia | Southern Asia | 142 | 034 | |||
Åland Islands | AX | ALA | 248 | ISO 3166-2:AX | Europe | Northern Europe | 150 | 154 | |||
Albania | AL | ALB | 008 | ISO 3166-2:AL | Europe | Southern Europe | 150 | 039 | |||
Algeria | DZ | DZA | 012 | ISO 3166-2:DZ | Africa | Northern Africa | 002 | 015 | |||
American Samoa | AS | ASM | 016 | ISO 3166-2:AS | Oceania | Polynesia | 009 | 061 | |||
Andorra | AD | AND | 020 | ISO 3166-2:AD | Europe | Southern Europe | 150 | 039 | |||
Angola | AO | AGO | 024 | ISO 3166-2:AO | Africa | Sub-Saharan Africa | Middle Africa | 002 | 202 | 017 | |
Anguilla | AI | AIA | 660 | ISO 3166-2:AI | Americas | Latin America and the Caribbean | Caribbean | 019 | 419 | 029 | |
Antarctica | AQ | ATA | 010 | ISO 3166-2:AQ |
OlderNewer