This file contains 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 | |
from requests.auth import HTTPBasicAuth | |
class GithubProvider(object): | |
"""docstring for GithubProvider""" | |
def __init__(self, repo, username, secret_key): | |
super(GithubProvider, self).__init__() |
This file contains 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
#!/bin/bash | |
# remove exited containers: | |
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v | |
# remove unused images: | |
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi | |
# remove unused volumes: | |
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <( |
This file contains 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
# set the vars | |
CLIENT_ID=xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
CLIENT_SECRET=xxxxxxxxxxxxxxxxxxx | |
[email protected] | |
PASSWORD=xxxxxxxxXXXXXXXXXXXXXXXXXXXXXXXX | |
INSTANCE_URL=https://xxxx.salesforce.com | |
# request the token | |
curl -d "grant_type=password&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&username=$EMAIL&password=$PASSWORD" $INSTANCE_URL/services/oauth2/token |
This file contains 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 java.text.SimpleDateFormat | |
object TS2Date4 { | |
def convert():String = { | |
val ts = System.currentTimeMillis() | |
val df:SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") | |
df.format(ts) | |
} | |
} |
This file contains 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
package com.example.salesforce | |
/** | |
* The object to acommodate the main method that will instantiate the `SObject` | |
*/ | |
object ObjectExporter { | |
/** | |
* Get the arguments from the command line, pass to the `SObject` constructor and | |
* call the `dumpNewlineDelimitedJson` method. |
This file contains 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
package com.example.salesforce | |
import java.util.List | |
import java.io.{BufferedWriter, File, FileWriter} | |
import org.apache.http.impl.client.{DefaultHttpClient,BasicResponseHandler} | |
import org.apache.http.client.methods.HttpGet | |
import com.typesafe.config.ConfigFactory | |
import com.google.gson.{Gson, JsonParser, JsonArray} | |
import scala.collection.JavaConversions._ |
This file contains 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
package com.example.salesforce | |
import java.io._ | |
import org.apache.commons._ | |
import org.apache.http._ | |
import org.apache.http.client._ | |
import org.apache.http.client.methods.HttpPost | |
import org.apache.http.impl.client.DefaultHttpClient | |
import org.apache.http.impl.client.BasicResponseHandler | |
import org.apache.http.client.ResponseHandler |
This file contains 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
package com.example.salesforce | |
import com.google.gson.Gson | |
import scala.collection.mutable.{Map, | |
SynchronizedMap, HashMap} | |
case class DescribeField(name: String, `type`: String) |
This file contains 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
force { | |
UserName = "[email protected]" | |
PassWord = "xxxxxxxxXXXXXXXXXXXXXXXXXXXXXXXX" | |
ClientID = "xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
ClientSecret = "xxxxxxxxxxxxxxxxxxx" | |
InstanceUrl = "https://xxxx.salesforce.com" | |
DataServiceUrl = "/services/data/v41.0" | |
} |
This file contains 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 os | |
from kafka import KafkaConsumer | |
from settings import BOOTSTRAP_SERVERS, TOPIC | |
consumer = KafkaConsumer(TOPIC, bootstrap_servers=BOOTSTRAP_SERVERS, auto_offset_reset='earliest') | |
print("connected to: {}".format(BOOTSTRAP_SERVERS)) | |
for message in consumer: | |
# message value and key are raw bytes -- decode if necessary! |
OlderNewer