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
def self.generate_video(video, text) | |
# og video name is self.video_name(video) | |
instagram_video = InstagramVideoGenerator.run(video: video, text: text) | |
system("mv #{instagram_video.path} #{output_dir_path}/instagram.mp4") | |
snapchat_video = SnapchatVideoGenerator.run(video: video, text: text) | |
system("mv #{snapchat_video.path} #{output_dir_path}/snapchat.mp4") | |
end |
This file has been truncated, but you can view the full file.
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
{id: 1234, order_count: 5} | |
{id: 1234, order_count: 5} | |
{id: 1234, order_count: 5} | |
{id: 1234, order_count: 5} | |
{id: 1234, order_count: 5} | |
{id: 1234, order_count: 5} | |
{id: 1234, order_count: 5} | |
{id: 1234, order_count: 5} | |
{id: 1234, order_count: 5} | |
{id: 1234, order_count: 5} |
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
var API = { | |
fetchSummary: function(date, completion) { | |
date = date || new Date(); | |
var self = this; | |
$.ajax({ | |
url: '/tweets', | |
type: 'GET', | |
data: { | |
date: date.toString(), | |
offset: -(date.getTimezoneOffset()) |
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
var Entity = { | |
render: function(e) { | |
var t = document.createElement("table"); | |
t.setAttribute("class", "table table-striped"), t.setAttribute("width", "100%"), t.appendChild(this._renderEntityHead(e)), t.appendChild(this._renderEntityBody(e)); | |
var n = document.createElement("div"); | |
return n.setAttribute("class", "entity"), n.appendChild(t), n | |
}, | |
_renderEntityHead: function() { | |
return this._renderHeader(["Entity", "Sentiment"]) | |
}, |
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
monthly = array | |
if monthly->has_posts { | |
year = get_year() | |
month = get_month() | |
<a href="post_link"> | |
get_the_date() | |
</a> | |
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
//: Playground - noun: a place where people can play | |
import Foundation | |
enum ValidatorResult { | |
case valid | |
case invalid(error: Error) | |
} | |
protocol Validator { |
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
function(t) { | |
var i, | |
n, | |
s = this.brush.img.width * this.scale, | |
e = this.brush.img.height * this.scale, | |
h = { | |
x: this.pointer.x, | |
y: this.pointer.y | |
}; | |
this.pointPosition(t); |
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
// OLD WAY | |
context("validation") { | |
it("requires a valid address") { | |
let order = Order() | |
order.address = Address() | |
let campaign = Factory.create(type: Campaign.self).state(.valid) | |
let product = campaign.products!.first! | |
let style = product.styles!.first! |
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
{ | |
"product" : { | |
"id" : 1, | |
"image_url" : "whatever.com" | |
}, | |
"color" : { | |
"id" : 1, | |
"name" : "White" | |
} | |
"campaign_name" : "whatever", |
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 UIKit | |
import Foundation | |
public protocol StoryboardInitializable: class {} | |
extension StoryboardInitializable where Self: UIViewController { | |
public static func initFromStoryboard() -> Self { | |
let className = NSStringFromClass(self).components(separatedBy: ".").last! | |
let storyboard = UIStoryboard(name: className, bundle: nil) | |
guard let viewController = storyboard.instantiateInitialViewController() as? Self else { |