Skip to content

Instantly share code, notes, and snippets.

View coddeys's full-sized avatar

Dimas coddeys

  • Capelle aan den IJssel
View GitHub Profile
@ohanhi
ohanhi / frp.md
Last active September 23, 2025 16:12
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

class Bob
def reply_to(statement)
public_send("reply_to_#{statement.class}".downcase.to_sym)
rescue NoMethodError
default_reply
end
def reply_to_silence
"Fine. Be that way!"
end
@vcunat
vcunat / xmonad.hs
Last active February 18, 2025 20:03
My XMonad config
import Data.List
import Data.Maybe (fromMaybe)
import qualified Data.Map as M
import XMonad
import XMonad.Config.Xfce (xfceConfig)
--import XMonad.Config.Gnome
--import XMonad.Config.Kde
import XMonad.Config.Desktop (desktopLayoutModifiers)
@mwlang
mwlang / error.txt
Created January 21, 2015 12:47
Below is an example of using Savon to test SOAP endpoints of a Rails app that uses Wash out. The Savon approach works, but Savon likes to mangle the XML you feed it by wrapping it in the SOAP Envelope and Body tags. Therefore, I'm trying to duplicate with Faraday what's working with Savon so I can fully control the XML being fed to the SOAP endp…
Failure/Error: response = post_xml(:stock_update, "single_item")
Faraday::ConnectionFailed:
getaddrinfo: nodename nor servname provided, or not known
# /Users/mwlang/.rvm/gems/ruby-2.1.2/gems/faraday-0.9.0/lib/faraday/adapter/net_http.rb:80:in `perform_request'
# /Users/mwlang/.rvm/gems/ruby-2.1.2/gems/faraday-0.9.0/lib/faraday/adapter/net_http.rb:39:in `call'
# /Users/mwlang/.rvm/gems/ruby-2.1.2/gems/faraday-0.9.0/lib/faraday/rack_builder.rb:139:in `build_response'
# /Users/mwlang/.rvm/gems/ruby-2.1.2/gems/faraday-0.9.0/lib/faraday/connection.rb:377:in `run_request'
# /Users/mwlang/.rvm/gems/ruby-2.1.2/gems/faraday-0.9.0/lib/faraday/connection.rb:177:in `post'
@varyonic
varyonic / gist:542c37648de91a02402a
Last active August 29, 2015 14:08
Deprecated but working version of form_buffers removed by https://github.com/activeadmin/activeadmin/pull/3486
module ActiveAdmin
module Views
class ActiveAdminForm
class DeprecatedFormBufferSubstitute
def initialize(form)
@form = form
end
def << (value)
@form.text_node value.html_safe
end
@rkjha
rkjha / nginx-config-rails4-with-puma-ssl-version.conf
Last active November 2, 2023 11:57
Nginx config for rails 4 application using puma [ssl and non-ssl version]
upstream myapp_puma {
server unix:/tmp/myapp_puma.sock fail_timeout=0;
}
# for redirecting to https version of the site
server {
listen 80;
rewrite ^(.*) https://$host$1 permanent;
}
@evancz
evancz / Architecture.md
Last active December 21, 2022 14:28
Ideas and guidelines for architecting larger applications in Elm to be modular and extensible

Architecture in Elm

This document is a collection of concepts and strategies to make large Elm projects modular and extensible.

We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp. You will probably merge a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:

  1. There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo
@staltz
staltz / introrx.md
Last active October 26, 2025 03:06
The introduction to Reactive Programming you've been missing
@davidcelis
davidcelis / nginx.conf
Last active October 22, 2025 18:39
Nginx configuration to redirect HTTP traffic to HTTPS (Puma)
upstream puma {
server unix:///var/www/app/shared/tmp/sockets/puma.sock fail_timeout=0;
}
server {
listen 80 default deferred;
server_name example.com;
rewrite ^/(.+) https://example.com/$1 permanent;
}
@jhjguxin
jhjguxin / creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
Created July 9, 2012 03:32
Creating nested resources in ruby on rails 3 and updating scaffolding links and redirection