- https://rubygems.org hosts the Ruby gem for Ruby on Rails.
- The current stable version number of Rails is 5.1.4, with 5.2.0.beta2 being the overall latest version.
- As of this writing, Ruby on Rails has been downloaded 118,011,892 across all versions.
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
Tyler Williams NationBuilder Developer Certification | |
Submitted 4/13/18 | |
This python program completes the following developer exercises: | |
Create an event | |
Edit an event | |
Create a person | |
Edit a person | |
Delete a person |
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
<?php | |
// NationBuilder functions | |
// It may eventually make sense to make these methods in OOP model | |
// Could turn into a NationBuilder PHP library or package | |
// Make a GET request using curl | |
// Takes one argument, $endpoint, which is the URL to hit with GET | |
// Expects a response in JSON format, decodes to array, returns the decoded JSON array | |
function nationbuilderGet($endpoint) { | |
// Make the curl request |
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
# Use RSpec for testing https://rspec.info/ | |
require 'rspec' | |
# Define the flatten function, we'll use it recursively | |
# On the initial run, set `results` to an empty array | |
def flatten(array, results = []) | |
# Check that array is not nil | |
if array | |
# For each item in the array, check if it's a nested array | |
array.each do |item| |
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
doSomeLongRunningTask(function(response, error) { | |
// This function is running as a CALLBACK inside the long task | |
// So it logs on completion | |
console.log(response) | |
// Return the response | |
return response; | |
} | |
var res = doSomeLongRunningTask(function(response, error) { |
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
class SampleObject < ApplicationRecord | |
def external_components | |
Rails.cache.fetch("#{cache_key_with_version}/components", expires_in: 12.hours) do | |
# Some long running task that fetches "components" | |
end | |
end | |
end |
- Get a GitHub account
- Sign up for Netlify with your GitHub account
- Download and install Visual Studio Code
- Download and install Node.js
- Install git:
- Mac OSX: Using the terminal, Install Homebrew and then install Git
- Windows: Download and install Git for Windows
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<link rel="stylesheet" type="text/css" href="css/app.css"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title></title> |
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 { makeAutoObservable, makeObservable, observable } from "mobx"; | |
import { DataModel, Model, model, prop } from "mobx-keystone"; | |
import { types } from "mobx-state-tree"; | |
function bench(f: () => { value: number }) { | |
// Warmup | |
let sum = 0; | |
for (let index = 0; index < 100_000; ++index) { | |
sum += f().value; | |
} |
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
#!/usr/bin/env node | |
/** | |
* If you put this program in your PATH, you can use it like this: | |
* | |
* ask "What is the meaning of life?" | |
* | |
* or | |
* | |
* ask my_file.md |
OlderNewer