# I got this working on a AWS EC2 G5 extra large instance with 80gb of storage
# Install required build packages and Python libraries
sudo ACCEPT_EULA=Y apt-get update
sudo ACCEPT_EULA=Y apt-get upgrade
sudo apt-get install software-properties-common build-essential libopenblas-dev ninja-build pkg-config cmake-data clang nvidia-cuda-toolkit
sudo apt-get install git git-lfs curl wget zip unzip
git lfs install
This file contains hidden or 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
<body id="collection-5670de8aa128e6d40ec12999" class="transparent-header enable-nav-button nav-button-style-outline nav-button-corner-style-pill banner-button-style-solid banner-button-corner-style-pill banner-slideshow-controls-arrows meta-priority-date center-entry-title--meta hide-entry-author hide-list-entry-footer center-navigation--info event-show-past-events event-thumbnails event-thumbnail-size-32-standard event-date-label event-list-show-cats event-list-date event-list-time event-list-address event-icalgcal-links event-excerpts gallery-design-grid aspect-ratio-auto lightbox-style-light gallery-navigation-bullets gallery-info-overlay-show-on-hover gallery-aspect-ratio-32-standard gallery-arrow-style-no-background gallery-transitions-fade gallery-show-arrows gallery-auto-crop product-list-titles-under product-list-alignment-center product-item-size-11-square product-image-auto-crop product-gallery-size-11-square show-product-price show-product-item-nav product-social-sharing newsletter-style-dark hide- |
This file contains hidden or 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
report = 'code_report_' + Time.now.strftime('%Y-%m-%d') | |
`rubocop app spec lib config --format simple --out #{report}.txt` | |
`echo "\n\n\nCANE REPORT\n\n-----------" >> #{report}.txt` | |
`cane >> #{report}.txt` | |
`echo "\n\n\nSANDI METER REPORT\n\n-----------" >> #{report}.txt` | |
`sandi_meter -d >> #{report}.txt` |
This file contains hidden or 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 WikiPolicy < ApplicationPolicy | |
attr_reader :user, :wiki | |
def initialize(user, wiki) | |
@user = user | |
@wiki = wiki | |
end | |
def update? | |
user.present? |
This file contains hidden or 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
require 'sinatra' | |
get '/' do | |
erb :index | |
end | |
__END__ | |
@@index |
This file contains hidden or 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 tiaosheng(failed_counter) | |
jumps = [] | |
[*1..60].map do |s| | |
if failed_counter.include?(s) | |
jumps << s << s << s << s | |
else | |
jumps << s | |
end | |
end | |
jumps[59] |
This file contains hidden or 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 TopicsController < ApplicationController | |
before_action :require_sign_in, except: [:index, :show] | |
before_action :authorize!, except: [:index, :show] | |
def index | |
@topics = Topic.all | |
end | |
def new | |
@topic = Topic.new |
This file contains hidden or 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
<% flash.each do |k,v| %> | |
<div class="alert alert-<%= k == 'notice' ? 'info' : 'danger' %> fade in"> | |
<button class="close" data-dismiss="alert"> | |
<i class="fa fa-fw fa-info"></i> | |
<strong><Info><%= k %>!</strong> <%= raw(v) %> | |
</button> | |
</div> | |
<% end %> |
This file contains hidden or 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
<% @items.each do |item| %> | |
<p> | |
<%= item.name %> | |
<%= form_for [current_user, item], method: :delete do |f| %> | |
<%= check_box_tag :complete, nil, false, onclick: "this.form.submit()" %> | |
<%= label_tag :complete, 'Complete' %> | |
<% end %> | |
</p> | |
<% end %> |
NewerOlder