Skip to content

Instantly share code, notes, and snippets.

View mikekavouras's full-sized avatar

Mike Kavouras mikekavouras

View GitHub Profile
@mikekavouras
mikekavouras / stuff.rb
Created March 27, 2017 04:10
stuff.rb
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.
{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}
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())
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"])
},
monthly = array
if monthly->has_posts {
year = get_year()
month = get_month()
<a href="post_link">
get_the_date()
</a>
//: Playground - noun: a place where people can play
import Foundation
enum ValidatorResult {
case valid
case invalid(error: Error)
}
protocol Validator {
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);
// 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!
{
"product" : {
"id" : 1,
"image_url" : "whatever.com"
},
"color" : {
"id" : 1,
"name" : "White"
}
"campaign_name" : "whatever",
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 {