Skip to content

Instantly share code, notes, and snippets.

View underhilllabs's full-sized avatar

Bart Lantz underhilllabs

View GitHub Profile
@underhilllabs
underhilllabs / sinatra_dokku.md
Last active December 7, 2023 16:19
Setting up a Sinatra app on Dokku

There are a few additional steps I noticed to setting up a Sinatra app to work on Dokku. (These are probably also required for deploying an app to Heroku.)

original app.rb

require 'sinatra'

get '/' do
  "Your Sinatra app is not quite Dokku-fied!"
end
@underhilllabs
underhilllabs / color-theme-leuven-org-section.el
Created May 17, 2011 16:11
orgmode variables for an emacs color theme from color-theme-leuven.el
;; Org
(org-agenda-clocking ((t ,clock-line)))
(org-agenda-column-dateline ((t (:inherit org-column))))
;; (org-agenda-column-dateline ((t (:background "deep sky blue" :height 79 :family "Consolas"))))
(org-agenda-current-time ((t (:weight bold :underline t :foreground "purple"))))
(org-agenda-date ((t (:height 1.6 :weight bold :foreground "#0063F5")))) ; "#87C9FC"
(org-agenda-date-today ((t (:height 1.6 :weight bold :foreground "purple")))) ; "#CCCCFF" ; inherit
(org-agenda-date-weekend ((t (:height 1.6 :weight bold :foreground "dim gray")))) ; "#B6B2AE" ; inherit
(org-agenda-diary ((t (:weight bold :foreground "green4" :background "light blue"))))
(org-agenda-dimmed-todo-face ((t (:foreground "gold2")))) ; org-blocked-todo
@underhilllabs
underhilllabs / FetchWeatherTask.java
Last active January 5, 2023 08:14
example AsyncTask in android
private class FetchWeatherTask extends AsyncTask<Void, Void, Void> {
private final String LOG_TAG = FetchWeatherTask.class.getSimpleName();
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;

pics from 1873

Array.class_eval do
def delete_elements_in(ary)
ary.each do |x|
if index = index(x)
delete_at(index)
end
end
end
end

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

  • what he lacks in knowlege, he makes up for in certainty
  • what she lacks in pitch control, she makes up in volume
  • what he lacks in taste. he makes up for in appetite

Top 5 games to play in Person

once Quarantine is lifted

Euros

  1. Gaia Project
  2. Age of Steam
  3. Hansa Teutonica
  4. Pax Viking
  5. Arkwright (spreadsheets w/o convenience of Macros).