Skip to content

Instantly share code, notes, and snippets.

@mcade
mcade / Main.elm
Created August 9, 2017 22:57
Initial Main.elm hello world app
module Main exposing (..)
import Html exposing (text)
main =
text "Hello, World!"
@mcade
mcade / index.html
Last active August 9, 2017 23:56
Basic index.html for Elm app
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Rhythm Press - A poetic exhibition of rhythm adn rhyme</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">
</head>
<body>
Interactive Elixir (1.3.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 02 Dec 10:34:51 - info: compiling
Elm compile: Main.elm, in web/elm, to ../static/js/elm.js
[BABEL] Note: The code generator has deoptimised the styling of "web/static/js/elm.js" as it exceeds the max of "100KB".
02 Dec 10:36:30 - info: compiling.
[info] GET /about-us
[debug] Processing by MyApp.PageController.index/2
Parameters: %{}
Pipelines: [:browser]
[info] Sent 200 in 357ms
2014-07-06 08:34:13.576 sample-chat[21542:90b] self.users contactList,pendingApproval=(
" userId: 0, online: 0, subscriptionState: none",
" userId: 1242638, online: 0, subscriptionState: none"
)
2014-07-06 08:34:13.576 sample-chat[21542:3e03] Performing async request:
GET https://api.quickblox.com/users.xml
headers:{
"QB-SDK" = "iOS 1.8.6";
"Qb-Token" = 727bd7a43149eb870a09cf0a6431fa0d24a40599;
"QuickBlox-REST-API-Version" = "0.1.1";
2014-07-06 06:41:33.204 sample-chat[21215:90b] -[QBContactListItem login]: unrecognized selector sent to instance 0xaa9a5f0
2014-07-06 06:41:33.206 sample-chat[21215:90b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[QBContactListItem login]: unrecognized selector sent to instance 0xaa9a5f0'
*** First throw call stack:
(
0 CoreFoundation 0x02e051e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x02b848e5 objc_exception_throw + 44
2 CoreFoundation 0x02ea2243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x02df550b ___forwarding___ + 1019
4 CoreFoundation 0x02df50ee _CF_forwarding_prep_0 + 14
5 sample-chat 0x0000a695 -[UsersViewController tableView:cellForRowAtIndexPath:] + 357
@mcade
mcade / gist:9999707
Last active August 29, 2015 13:58
link_to query
microposts_controller.rb
def index
@micropost = current_user.microposts.build
@microposts = case params["show"]
when "daily"
Kaminari.paginate_array(Micropost.popularToday).page(params[:page]).per(25)
when "weekly"
Kaminari.paginate_array(Micropost.popularWeekly).page(params[:page]).per(25)
when "monthly"
@mcade
mcade / gist:9778965
Created March 26, 2014 08:41
config/database.example.yml
+development:
+ adapter: postgresql
+ encoding: unicode
+ database: promptku_development
+ host: localhost
+ pool: 5
+ username:
+ password:
+
+test:
@mcade
mcade / gist:9778958
Created March 26, 2014 08:40
config/routes.rb
end
resources :sessions, only: [:new, :create, :destroy]
resources :microposts, only: [:create, :destroy] do
- member { post :vote }
- member { post :retweet}
+ member do
+ post :vote
+ post :retweet
+ end
end
@mcade
mcade / gist:9778954
Created March 26, 2014 08:40
.ruby-version
2.0.0