Skip to content

Instantly share code, notes, and snippets.

View nicholalexander's full-sized avatar

nichol alexander nicholalexander

View GitHub Profile

#The NYC DevShop 40 Step Server Deploy Guide Written by The DevShop Team

###1. Create A Droplet In A Digital Ocean

  • Log in to Digital Ocean
  • Enter hostname - this should be something useful to you, maybe your Appname?
  • Select a 1gb / 1cpu Droplet
  • Use Ubuntu 12.0.4
  • Do not use ssh keys!
@nicholalexander
nicholalexander / font-face.md
Last active August 29, 2015 13:57
setting up fonts in rails 4

It's Easy!

  1. Put this in your application.rb

     config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
     config.assets.precompile += %w( .svg .eot .woff .ttf )
    
  2. Reboot your server!

  3. Create a fonts.scss file in assets/stylesheets.

  4. Set up your font-face thusly. Pay extra attention to punctuation - everything must appear exactly as it does in the file system.

Keybase proof

I hereby claim:

  • I am nicholalexander on github.
  • I am nicholalexander (https://keybase.io/nicholalexander) on keybase.
  • I have a public key whose fingerprint is DA8A F0BB 0149 82CA 7928 6F29 6EA0 FEC6 9B6A 73D0

To claim this, I am signing this object:

<!doctype><html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Odyssey.js Torque</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png">
<link rel="icon" type="image/png" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png">
@nicholalexander
nicholalexander / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Verifying I am +nicholalexander on my passcard. https://onename.com/nicholalexander

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),

@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.

@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 / 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