Skip to content

Instantly share code, notes, and snippets.

View nicholalexander's full-sized avatar

nichol alexander nicholalexander

View GitHub Profile

Sad that I missed RubyConf! Looking through tweets, I saw some pictures of job board. I very quickly wrote down everything I could make out in the hopes that a text version might be helpful to some.

The order is roughly in columns, left to right. If there is anything that's wrong or missing, please let me know and I'll change it. Thanks to @filipebarcos and this (tweet)[https://twitter.com/filipebarcos/status/1197201242700812288?s=09] as being my best source.

https://anvyl.com/
jason@anvyl.com
Supply chain

Vimeo
# Write a program that prints out the numbers 1 to 100 (inclusive). If the number is
# divisible by 3, print Crackle instead of the number. If it's divisible by 5, print Pop.
# If it's divisible by both 3 and 5, print CracklePop. You can use any language.
module CracklePop
class CracklePop
class << self
def evaluate_and_print(number)
puts evaluate(number)
end
Verifying my Blockstack ID is secured with the address 1BYc9aSw293aREXVXjEKBTwnAyPrTVSksM https://explorer.blockstack.org/address/1BYc9aSw293aREXVXjEKBTwnAyPrTVSksM

Keybase proof

I hereby claim:

  • I am nicholalexander on github.
  • I am nicholalexander (https://keybase.io/nicholalexander) on keybase.
  • I have a public key ASC-4tXcTOXB3LGLqRzxdRQtb-teLSUpgaSJ9EL6yVm-VQo

To claim this, I am signing this object:

Checklist for Heroku/Sinatra/Active Record App Deployment

1. Write your app - YAY!

2. Prepare Your App

  • Set up your environments.rb file

    • mkdir config
    • touch config/environments.rb
  • Set it up thusly:
#the fiddle class in ruby
#http://ruby-doc.org/stdlib-2.0.0/libdoc/fiddle/rdoc/Fiddle/Pointer.html#method-c-new
require 'fiddle'
require 'pry'
#this is a regular variable holding a string, aka a string object with the
#value "hello strange person"
my_string = "hello strange person!"
#this gets an integer pointing to location of your object in memmory.
@nicholalexander
nicholalexander / custom_array.rb
Created November 22, 2013 18:52
creating a custom array by inheriting and redefining...
class LifeBoardArray < Array
def [](index)
if index<=3
super(index)
elsif index > 3
super(index%4)
else
raise IndexError
end
@nicholalexander
nicholalexander / gist:7413525
Created November 11, 2013 13:55
a script to build the sinatra skeleton and minimal config of files. missing sinatra reloader and ability to set path. chmod 755 to make executable - and also i think it has to be in the path where you're building, i don't know how it would work to make it part of your bin folder.
#!/bin/sh
mkdir app
cd app
mkdir public
mkdir views
touch server.rb
echo "require 'pry' \n require 'sinatra' \n \n get '/' do \n erb :index \n end \n" >> server.rb
cd public
@nicholalexander
nicholalexander / javascript-recipie.md
Last active December 27, 2015 13:49
an attempt to break down the javascript work in class into some logical steps.

My Javascript Logic Recipie

I have found that the Javascript work we have done so far lends itself to encapsulate in logical steps. When starting new javascript work, here is the little cookbook/recipie I follow. Here are my thoughts using TicTacToe and PixArt as examples.

1) Datamodeling

I am going to define the object as the game. So that I can say myGame = new TicTacToe();

My game needs a board. It needs players, but X always goes first. And the game is either won or unwon but when it starts, there is no winner. I think my game should have how many moves have been played (but this could also be figured out by inspecting the board).

The actions I will have are only two: make a move, and see if someone has won.

installing gmaps4rails

##controller

@hash = Gmaps4rails.build_markers(@posts) do |post, marker|
    marker.lat post.latitude.to_f
    marker.lng post.longitude.to_f
    marker.picture({

:url => post.image.url(:thumb),