GitHub Hosting - the -poor +rich man's hosting provider.
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
{ | |
"workshops":[ | |
{ | |
"title":"INTRO TO PYTHON", | |
"description":"Explore the intersection of coding and data with General Assembly. During our Python-focused intro class, you’ll learn you’ll learn all about Python - including how to get started, advantages and disadvantages of Python, essentials of programming in Python, and tools available to build applications in Python.", | |
"instructor":"Terence Stone", | |
"date":"Monday, 4 February", | |
"time":"6:30 – 8:30 pm EST" | |
}, | |
{ |
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
// Load HTTP module | |
const http = require("http"); | |
// Create HTTP server and listen on port 8000 for requests | |
http.createServer(function(request, response) { | |
// Set the response HTTP header with HTTP status and Content type | |
response.writeHead(200, {'Content-Type': 'text/plain'}); | |
// Send the response body "Hello World" |
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 check_for_existing_membership | |
accounts = Account.where(email_address: email) | |
accounts.each do |account| | |
if account.portals.pluck(:id) == portal.id | |
errors.add(:duplicate, 'The email is already associated with members of this organization') | |
return false | |
end | |
end | |
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 adjacentElementsProduct(inputArray) { | |
let previousElement; | |
let largestProduct = inputArray[0]*inputArray[1]; | |
inputArray.forEach(function(currentElement, index){ | |
if (index === 0) { | |
previousElement = currentElement; | |
return; | |
} | |
else if (previousElement*currentElement > largestProduct) { | |
largestProduct = previousElement*currentElement |
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
namespace :populate do | |
desc "Populate data from Foursqaure API" | |
task :foursquare => :environment do | |
client = Foursquare2::Client.new(:client_id => 'CLIENT_ID', :client_secret => 'CLIENT_SECRET', :api_version => '20140904') | |
Cities.data_path = "lib/tasks/cities" | |
cities = Cities.cities_in_country('US') | |
limit = 5000 # Foursqaure rate limit up to 5,000 userless requests per hour to venues/* endpoints. |
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 change_due(input) | |
quarters= (input/25) | |
dimes=((input%25)/10) | |
nickles=(((input%25)%10)/5) | |
pennies=(input%5) | |
puts "#{quarters} quarters, #{dimes} dimes, #{nickles} nickles, and #{pennies} pennies" | |
end |
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
<%= form_for @person do |f| %> | |
<%= f.label :first_name, "First Name" %>: | |
<%= f.text_field :first_name, list: 'first-name' %> | |
<datalist id="first-name"> | |
<% Person.all.each do |person| %> | |
<option value="<%= person.first_name %>"></option> | |
<% end %> | |
</datalist> | |
<%= f.submit %> | |
<% end %> |
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
<!DOCTYPE html> | |
<!-- | |
-- Bruno Galvao | |
-- 12/11/11 | |
-- Bluewolf Coding Assignment | |
--> | |
<html> | |
<head> |
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
' Bruno Galvao | |
' 11/12/11 | |
' | |
' Given an array of integers between 1 and 1,000,000. | |
' One integer is in the array twice. Find the duplicate. | |
Module Module1 | |
Sub Main() |