gem 'simple_form'rails generate simple_form:install| #!/bin/bash | |
| # Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/ | |
| set -e | |
| sourceApp="$1" | |
| targetApp="$2" | |
| while read key value; do |
| // Requires jQuery of course. | |
| $(document).ready(function() { | |
| $('.show-comments').on('click', function(){ | |
| var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username. | |
| // ajax request to load the disqus javascript | |
| $.ajax({ | |
| type: "GET", | |
| url: "http://" + disqus_shortname + ".disqus.com/embed.js", | |
| dataType: "script", |
| # Use this setup block to configure all options available in SimpleForm. | |
| SimpleForm.setup do |config| | |
| # you need an updated simple_form gem for this to work, I'm referring to the git repo in my Gemfile | |
| config.input_class = "form-control" | |
| config.wrappers :bootstrap, tag: 'div', class: 'form-group', error_class: 'error' do |b| | |
| b.use :html5 | |
| b.use :placeholder | |
| b.use :label | |
| b.use :input |
| #!/bin/bash | |
| mkdir -p ~/.ssh | |
| # generate new personal ed25519 ssh keys | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>" | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <rob@rob.tn>" | |
| # generate new host cert authority (host_ca) ed25519 ssh key | |
| # used for signing host keys and creating host certs |
| #!/usr/bin/env ruby | |
| # usage: saveimages.rb <url> | |
| # locally save all images from a web site | |
| require 'nokogiri' | |
| require 'open-uri' | |
| exit if ARGV[0].nil? |
| class AppleRecord < Record | |
| end |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #somewhere in a controller | |
| CreateOrder.new(OrderRepository).create current_user, params | |
| # where | |
| class CreateOrder < UseCaseService | |
| def initialize order_repo | |
| @order_repo = order_repo |
| -- AppleScript -- | |
| -- This example is meant as a simple starting point to show how to get the information in the simplest available way. | |
| -- Keep in mind that when asking for a `return` after another, only the first one will be output. | |
| -- This method is as good as its JXA counterpart. | |
| -- Webkit variants include "Safari", "Webkit", "Orion". | |
| -- Specific editions are valid, including "Safari Technology Preview". | |
| -- "Safari" Example: | |
| tell application "Safari" to return name of front document |