Skip to content

Instantly share code, notes, and snippets.

Coding time

Vinicius Souza vsouza

Coding time
Block or report user

Report or block vsouza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
vsouza / main.go
Created May 27, 2018 — forked from cespare/main.go
Example of testing Go HTTP servers using httptest.Server.
View main.go
package main
import (
const addr = "localhost:12345"
vsouza / gist:cc16d0af73ebb1ac4e175ce61f908a04
Created Jan 2, 2018 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions
View gist:cc16d0af73ebb1ac4e175ce61f908a04


Quick Legend

Instance Branch Description, Instructions, Notes
def toRedshift(time, rdd):
sqlContext = getSqlContextInstance(rdd.context)
schema = StructType([
StructField('user_id', StringType(), True),
StructField('device_id', StringType(), True),
StructField('steps', IntegerType(), True),
StructField('battery_level', IntegerType(), True),
StructField('calories_spent', IntegerType(), True),
spark_context = SparkContext(appName=kinesis_app_name)
spark_streaming_context = StreamingContext(spark_context, spark_batch_interval)
sql_context = SQLContext(spark_context)
kinesis_stream = KinesisUtils.createStream(
spark_streaming_context, kinesis_app_name, kinesis_stream, kinesis_endpoint,
aws_region, kinesis_initial_position, kinesis_checkpoint_interval)
py_rdd = x: json.loads(x))
from __future__ import print_function
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
from pyspark.streaming.kinesis import KinesisUtils, InitialPositionInStream
import datetime
import json
from pyspark.sql import SQLContext, Row
from pyspark.sql.types import *
aws_region = 'us-east-1'
vsouza / request.swift
Last active May 31, 2016
Simple HTTP request. Swift backend implementation
View request.swift
import HTTP
import File
import HTTPSClient
import JSON
var url: String?
do {
let client = try! Client(uri: "")
var response = try client.get("/repos/vsouza/awesome-ios/git/trees/HEAD")
let buffer = try response.body.becomeBuffer()
vsouza / colorsUtil.swift
Last active Jul 20, 2017
Convert hex string to UIColor
View colorsUtil.swift
// ColorsUtil.swift
// Created by Vinicius Souza on 5/11/16.
// Copyright © 2016 Vinicius Souza. All rights reserved.
import Foundation
import UIKit
vsouza / GQL.swift
Created Mar 28, 2016 — forked from davbeck/GQL.swift
GraphQL data structure implemented in Swift
View GQL.swift
import Foundation
protocol GQLNodeArgument {}
extension String: GQLNodeArgument {}
extension NSNumber: GQLNodeArgument {}
class GQLNode: StringLiteralConvertible, ArrayLiteralConvertible, Printable, DebugPrintable {
let name: String?
You can’t perform that action at this time.