Skip to content

Instantly share code, notes, and snippets.

View chrislerum's full-sized avatar

Chris Lerum chrislerum

View GitHub Profile
server {
client_max_body_size 500M;
passenger_friendly_error_pages on;
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name sempermedusa.com;
passenger_enabled on;
rails_env production;
root /home/deploy/sites/sempermed/current/public;
@chrislerum
chrislerum / stack trace
Created February 26, 2015 16:25
simulator for iphone and iwatch both appear, but getting this immediately in console
rake watch
Build ./build/iPhoneSimulator-8.2-Development
Build MyWatchApp/build/iPhoneSimulator-8.2-Development
Compile MyWatchApp/app/glance_controller.rb
Compile ../../../.gem/ruby/2.2.0/gems/ib-0.7.2/lib/ib/outlets.rb
Compile MyWatchApp/app/interface_controller.rb
Compile MyWatchApp/app/notification_controller.rb
Create MyWatchApp/build/iPhoneSimulator-8.2-Development/MyHostApp WatchKit Extension.appex
Link MyWatchApp/build/iPhoneSimulator-8.2-Development/MyHostApp WatchKit Extension.appex/MyHostApp WatchKit Extension
Create MyWatchApp/build/iPhoneSimulator-8.2-Development/MyHostApp WatchKit Extension.appex/Info.plist
@chrislerum
chrislerum / main_view_controller.rb
Created February 17, 2015 22:36
app starts fine, tap button and picker shows, start to scroll picker, immediate crash
class MainViewController < UIViewController
def viewDidLoad
show_picker_button = UIButton.buttonWithType UIButtonTypeRoundedRect
show_picker_button.setTitle "Show Year Picker", forState: UIControlStateNormal
show_picker_button.frame = [[100, 100], [100, 50]]
show_picker_button.addTarget(self,
action: :show_year_picker,
forControlEvents: UIControlEventTouchUpInside)
self.view.addSubview show_picker_button
class BoxesLayout < MK::Layout
view :one
def layout
add OneViewController.new.view, :one
end
def one_style
background_color "#ff0000".uicolor
@chrislerum
chrislerum / products_controller.rb
Last active August 29, 2015 14:14
search snippet
20 @all_products.each do |i|
21 if (i.description.include? params[:query]) || (i.name.include? params[:query])
22 @products << i
23 end
24 end
#is this better?:
21 @products = all_products.reject do |i|
22 (!i.description.include? params[:query]) && (!i.name.include? params[:query])
Failure/Error: it {should validate_presence_of(:last_name)}
NoMethodError:
undefined method `>' for nil:NilClass
@chrislerum
chrislerum / error
Created January 13, 2015 14:41
trying to authenticate for rails_admin with devise
private method `current_user' called for #<RailsAdmin::MainController:0x007ffe52976be0>
@chrislerum
chrislerum / gist:abb2dc7e708838ce0846
Last active August 29, 2015 14:13
snippet of slim
code: (slim in view)
.page-header
h1 One
small Two
expected:
<div class="page-header">
<h1>
One
<small>
[03:35:20 INFO]: Starting Minecraft server on *:25565
[03:35:20 INFO]: Set PluginClassLoader as parallel capable
[03:35:20 ERROR]: Could not load 'plugins/DynmapPlotMe.jar' in folder 'plugins'
org.bukkit.plugin.UnknownDependencyException: dynmap
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:223) [spigot-1.8-R0.1-SNAPSHOT.jar:git-Spigot-"a394151"]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:288) [spigot-1.8-R0.1-SNAPSHOT.jar:git-Spigot-"a394151"]
at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:152) [spigot-1.8-R0.1-SNAPSHOT.jar:git-Spigot-"a394151"]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:496) [spigot-1.8-R0.1-SNAPSHOT.jar:git-Spigot-"a394151"]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
= form_for(@profile) do |f|
= f.hidden_field @hidden_field_name, :value => @hidden_field_value
= f.submit @button_message, class: "btn btn-success btn-sm pull-left btn-group-item", data: { confirm: @button_confirmation }