Skip to content

Instantly share code, notes, and snippets.

@evancz
evancz / data-interchange.md
Last active April 29, 2024 16:53
Why do I have to write JSON decoders in Elm?

A vision for data interchange in Elm

How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?

These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.

Literature Review

By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.

@TheSeamau5
TheSeamau5 / swipepageselm.elm
Last active September 20, 2016 08:10
Swipeable Pages in Elm
import Html exposing (Html)
import Html.Attributes
import Html.Events
import Mouse
import Signal exposing (Signal, Address)
import StartApp
import Json.Decode exposing ((:=))
import List
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@evancz
evancz / Guidelines.md
Last active October 17, 2023 05:36
Some thoughts on how to have nicer discussions online

Towards Discussion Guidelines

I personally like to have discussions in the spirit of the Socratic method. Instead of declaring my opinion, I ask a relevant question. How about this situation? What about this case? This has two possible outcomes.

  1. The other person explains to me how things work in that case. I realize that I misunderstood, and we both come out enriched and in agreement.
  2. The other person realizes that those situations are not covered. They realize they misunderstood, and we both come out enriched and in agreement.

In both cases, it could have been a conflict, egos crashing together. But by asking questions, it becomes a collaboration to find the best answer. Even the simple act of asking a question in the first place says, "I care what you have to say, we can agree on this." That said, I have noticed that it is definitely still possible for things to go wrong within this framework. How can this happen?

There was a passage from [The

@gosseti
gosseti / form.html
Last active February 21, 2017 18:28
A credit card form using jQuery.payment
<form accept-charset="UTF-8" action="/payment" class="cardInfo" method="post">
<fieldset class="cardInfo__cardDetails">
<div class="form-row cardInfo__cc-num">
<label for="cc-num"><abbr title="required">*</abbr><span>Card Number</span></label>
<div class="cc-num__wrap">
<!-- using type="tel" because type="number" doesn’t pass HTML5 form validation with jQuery.payment formatting -->
<input id="cc-num" type="tel" class="paymentInput cc-num" placeholder="•••• •••• •••• ••••" autocompletetype="cc-number" required="required">
<span class="card" aria-hidden="true"></span>
@ssaunier
ssaunier / heroku-CVE-2013-4164.rb
Last active December 29, 2015 04:09
On Saturday November 23rd, 2013, Heroku sent an email about CVE-2013-4164 to tell us to upgrade. Here is a script listing vulnerable apps.
#!/usr/bin/env ruby
#
# To simply run this script from your terminal:
# $ ruby -e "$(curl -fsSL https://gist.github.com/ssaunier/7612827/raw/heroku-CVE-2013-4164.rb)"
#
# From Heroku email, you must upgrade your ruby version to:
#
# New: ruby 1.8.7p375 (2013-11-22 revision 375) [x86_64-linux]
# New: ruby 1.9.2p321 (2013-11-22 revision 321) [x86_64-linux]
# New: ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

Hi everyone,

It's time we had The Talk.

The tech world is currently managing its inclusion / exclusion / minorities problem. It's not always pretty. It's never pleasant, but it's necessary.

I've been dragged in an ugly troll around ParisRB. Full transparency is the only way to deal with this, so here it is. I know speed is key, as sad rumors are already spreading.

We'll have to set facts straight:

@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@jhchabran
jhchabran / apéro_ruby_20_sept.md
Created September 21, 2011 08:42
Compte rendu de l'apéro ruby, spécial Freelance ( au loop, 20 septembre 2011 )

Intro

  • Comment s'y prendre pour devenir freelance en france ( rails )
  • statut idéal en fonction des tranches de gains
  • Quels types de clients
  • Dev conseils, formations
  • Collaboration type avec un client
  • TDD
  • Design avant ou après le dev