Skip to content

Instantly share code, notes, and snippets.

View rolandobrown's full-sized avatar

Rolando Brown rolandobrown

View GitHub Profile
/*1494946880,,JIT Construction: v3023720,en_US*/
/**
* Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
*
* You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
* copy, modify, and distribute this software in source code or binary form for use
* in connection with the web services and APIs provided by Facebook.
*
* As with any software that integrates with the Facebook platform, your use of
* this software is subject to the Facebook Platform Policy
@rolandobrown
rolandobrown / import_into_carto.rb
Created January 18, 2018 19:00
import_into_carto with content_guessing=true
import_into_carto("grow_test_government_body_assembly")
def import_into_carto(file_name)
`curl -v -F file=@public/data/#{file_name}.csv "https://advocacy-institute.carto.com/api/v1/imports/?api_key=#{ENV["CARTO_API_KEY"]}&content_guessing=true"`
puts "carto staging dataset uploaded".colorize(:green)
end
@rolandobrown
rolandobrown / add_action.php
Created May 17, 2017 03:09
source code for add action method
add_action('wp_head', 'revenglish_scripts');
function revenglish_scripts() {
?>
<script>
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.com/en_US/messenger.Extensions.js";
fjs.parentNode.insertBefore(js, fjs);
@rolandobrown
rolandobrown / data.rb
Created October 8, 2015 07:43
Sample of Data Class from Ruby AI
# "String"
#----------#
# A string is any finite sequence of characters (i.e., letters, numerals, symbols and punctuation marks).
# Strings are wrapped in quotes: "String"
# Strings can be stores in variables. Below are a few @@globalvariables
# MINASWAN is a Ruby programming motto designed to promote positivity and goodwill among community members.
@@minaswan = 'Matz is Nice And So We Are Nice.'
# [Arrays]
@rolandobrown
rolandobrown / parable.rb
Last active October 8, 2015 07:38
Octavia Class
# "Class"
#----------#
# In object-oriented programming, a class is an extensible program-code-template for creating objects
# providing initial values for state (member variables) and implementations of behavior (member functions or methods).
class Parable
require "./lib/concerns/think"
@@octavia_butler_golden_hash = {
@rolandobrown
rolandobrown / rubyAI.rb
Created October 8, 2015 07:37
# Required Gems RubyAI
# Required Gems
source "https://rubygems.org"
gem 'pry'
gem 'talks'
gem 'formatador'
gem 'lita-ascii-art'
@rolandobrown
rolandobrown / aretha_spec.rb
Created August 25, 2015 11:53
Aretha RSpec
# aretha_spec.rb
require_relative '../aretha.rb' #connect test to code
aretha = Aretha.new
RSpec.describe Aretha do
describe "#done_you_wrong!" do
it "ain't gonna do you wrong while you're gone" do
expect(aretha.done_you_wrong!).not_to be_truthy
end
@rolandobrown
rolandobrown / aretha.rb
Created August 25, 2015 11:51
Aretha.rb
class Aretha
def done_you_wrong!
false
end
def wanna_do_you_wrong(truth)
@truth = truth
false unless truth != "False"
@rolandobrown
rolandobrown / shouldbe_expect.rb
Created August 25, 2015 09:46
RSpec Syntax should_be Expect
Old: my_object.should_not_be_a_kind_of(Foo)
New: expect(my_object).not_to be_a_kind_of(Foo)
@rolandobrown
rolandobrown / new_gist_file_0
Last active August 29, 2015 14:28
RSpec Help
rspec --help