Skip to content

Instantly share code, notes, and snippets.

View zackn9ne's full-sized avatar

zackn9ne zackn9ne

  • earth, New York
View GitHub Profile
@zackn9ne
zackn9ne / config
Created July 11, 2014 15:47
.ssh/config file syntax
Host clockwork
  HostName 54.187.86.70
  User ubuntu
  IdentityFile ~/.ssh/my_ec2_private_key.pem
@zackn9ne
zackn9ne / logout.rb
Created September 18, 2014 23:33
dvise logout
<%= link_to('Logout x', destroy_user_session_path, :method => :delete) %>
@zackn9ne
zackn9ne / welcome.html.erb
Created September 19, 2014 00:11
devise welcome
welcome <%= current_user.email %>
@zackn9ne
zackn9ne / _controller.rb
Created September 19, 2014 00:13
dvise blacklisting via controller
before_action :authenticate_user!, only: [:index]
@zackn9ne
zackn9ne / typical_controller.rb
Created October 9, 2014 17:26
basic controller
def index
@museums = Museum.all
# @museums = Museum.search_for(params[:q])
# go into the models and rails.rb in order to allow the .search_for method to be available in a sort of whitelisted way
end
def new
@museum = Museum.new
end
@zackn9ne
zackn9ne / index.html.erb
Created October 9, 2014 17:44
basic ruby index file
<!DOCTYPE html>
<html>
<head>
<title>Artist</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
@zackn9ne
zackn9ne / infinate_loop.js
Created October 15, 2014 16:17
an infinate loop in js, dependancies are jQuery
<script>
colors = ["aquamarine", "lavender", "blue"]
$(".col-md-4").click(function() {
var current_color = $(this).data("color-index");
console.log(current_color);
current_color++;
if (current_color > colors.length - 1){
current_color = 0;
};
$(this).css("background", colors[current_color]);
@zackn9ne
zackn9ne / infinate_js.html
Created October 15, 2014 16:19
infinate js and html
<div class="row">
<div class="col-md-4" style="background: aquamarine;" data-color- index="0">.col-md-4</div>
<div class="col-md-4" style="background: lavender;" data-color- index="1">.col-md-4</div>
<div class="col-md-4" style="background: blue;" data-color-index="2">. col-md-4</div>
</div>
@zackn9ne
zackn9ne / font_glyphs.css
Created November 19, 2014 00:49
css glyphicons via font awesome
.other-actions a:before {
font-family: "Font Awesome";
font-weight: normal;
margin: 0px 10px 0px -10px;
display: inline-block;
line-height: 1;
}
.other-donate:before {
content: "";
@zackn9ne
zackn9ne / regex.txt
Created December 1, 2014 16:12
regex find in brackets
\[(.*?)\]