Skip to content

Instantly share code, notes, and snippets.

View jaimeiniesta's full-sized avatar

Jaime Iniesta jaimeiniesta

View GitHub Profile
defmodule Logics do
def xor(x, x) do
false
end
def xor(_x, _y) do
true
end
end
Model CPU RAM HDD Ports Price
2015 i7 3.1 GHz 16 Gb 1.866 MHz 1 Tb 2 Thunderbolt 2 3.009 €
2016 no touchbar i7 2.4 GHz 16 Gb 1.866 MHz 1 Tb 2 Thunderbolt 3 3.019 €
2016 touchbar i7 3.3 GHz 16 Gb 2.133 MHz 1 Tb 4 Thunderbolt 3 3.279 €

BREAKING NEWS: it works!!!

This test was green when the table used int IDs, but fails after the change to UUID:

test "creates resource and redirects when data is valid", %{conn: conn} do
  conn = post conn, sitemap_path(conn, :create), sitemap: @valid_attrs
  assert sitemap = Repo.get_by(Sitemap, @valid_attrs)
  assert redirected_to(conn) == sitemap_path(conn, :show, sitemap)
end
Results run on MacBook Air, 1.8 GHz, at home (100 Mbps connection)
Benchmarking MetaInspector 4.7.2, Ruby 2.2.3
user system total real
request and initialize: 0.450000 0.050000 0.500000 ( 4.528165)
with resolved url: 0.280000 0.020000 0.300000 ( 0.991626)
with document: 0.140000 0.010000 0.150000 ( 0.145772)
meta_tags: 0.020000 0.000000 0.020000 ( 0.017931)
links.all: 0.100000 0.000000 0.100000 ( 0.106687)
images: 0.000000 0.000000 0.000000 ( 0.000014)
@jaimeiniesta
jaimeiniesta / digital-tablet-tips.md
Last active April 14, 2023 23:59
Learning to draw

Tips about drawing digitally

I asked on https://www.facebook.com/groups/1014974001864957/permalink/1252338398128515/ and these were the main points:

  • Set the tablet settings, on the driver and on the software used for drawing. For example, pressure sensitivity.
  • Check the projection: what screen you're using to project the table and ensure the "constrain proportions" setting is checked.
  • Consider line stabilizing software like Lazy Nezumi Pro (only Windows so far). Sketchbook Pro has this sort of line as well.
  • Use Mischief rather than Photoshop for line drawing. It's simpler and produces more natural line drawing, which can be later exported for rendering in Photoshop.
  • Get comfortable with using undo constantly.
  • Use hard felt nibs for the tablet, the have increased friction and feel more like a pen on paper.
@jaimeiniesta
jaimeiniesta / response.bash
Created March 23, 2015 01:44
Example of 400 Bad Request response from Tenon
➔ curl -i -X POST -H Content-Type:application/x-www-form-urlencoded -H Cache-Control:no-cache -d 'url=bad&key=my-api-key' http://tenon.io/api/
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Mon, 23 Mar 2015 01:42:00 GMT
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.5.9-1ubuntu4.5
Set-Cookie: PHPSESSID=g119888uljiho5ihgmfsh70ga3; path=/
@jaimeiniesta
jaimeiniesta / cli_response.json
Created March 16, 2015 09:04
JSON CLI Vs Web response on validator.nu
{
"messages": [
{
"type": "info",
"url": "http://validationhell.com",
"lastLine": 1,
"lastColumn": 109,
"firstColumn": 1,
"subType": "warning",
"message": "Obsolete doctype. Expected “<!DOCTYPE html>”.",