This file contains 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
package com.example.android.hello_world; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.widget.TextView; | |
class HelloWorld < Activity | |
def onCreate(state:Bundle) | |
super state | |
tv = TextView.new(self) |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.android.hello_world" | |
android:versionCode="1" | |
android:versionName="1.0"> | |
<application android:label="@string/app_name" | |
android:debuggable="true" | |
android:icon="@drawable/ic_launcher"> | |
<activity android:name=".HelloWorld" |
This file contains 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
domain lan | |
search lan | |
nameserver 192.168.56.1 |
This file contains 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
#!/bin/sh | |
adb forward tcp:41927 tcp:41927 | |
sudo cp /etc/resolv.conf /etc/resolv.conf.azilink.bak | |
sudo cp /path/to/resolv.azilink /etc/resolv.conf | |
sudo openvpn /path/to/azilink.ovpn |
This file contains 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
rails generate skizmo:form Foo | |
With Foo.rb (model like this): | |
class Foo < ActiveRecord::Base | |
has_many :bars | |
belongs_to :baz | |
accepts_nested_attributes_for :bars | |
accepts_nested_attributes_for :baz | |
end |
This file contains 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
module FooSetupHelper | |
def setup_foo(obj) | |
obj.build_baz if obj.baz.blank? | |
obj.bars.build if obj.bars.empty? | |
return obj | |
end | |
def build_select_list(assoc, options={}) | |
name = options[:name] || "name" | |
scope = options[:scope] || "all" |
This file contains 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
<h1>New foo</h1> | |
<%= render 'form' %> | |
<%= link_to 'back', :back %> |
This file contains 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
<h1>Editing foo</h1> | |
<%= render 'form' %> | |
<%= link_to 'back', :back %> |
This file contains 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
<%= form_for setup_foo(@foo), :html => { :multipart => true } do |f| %> | |
<% if @foo.errors.any? %> | |
<div id="errorExplanation"> | |
<h2><%= pluralize(@foo.errors.count, "error") %> prohibited this foo from being saved:</h2> | |
<ul> | |
<% @foo.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> | |
</div> |
This file contains 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
<div class="fields"> | |
<div class="field"> | |
<%= f.label :name %> | |
<%= f.text_field :name %> | |
</div> | |
<div class="field"> | |
<%= f.label :bar %> | |
<%= f.text_field :bar %> | |
</div> | |
<%= link_to_remove_fields "remove", f %> |