Skip to content

Instantly share code, notes, and snippets.

View jaimeiniesta's full-sized avatar

Jaime Iniesta jaimeiniesta

View GitHub Profile
@thbar
thbar / settings.jsonc
Last active May 12, 2020 10:36
Current minimalistic VSCode setup (à la atom/textmate)
{
// NOTE: these settings work well for me
// using Ruby, Elixir and Assembly languages.
//
// I would probably do something different if
// I worked more with other languages at the moment
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"workbench.startupEditor": "newUntitledFile",
@wosephjeber
wosephjeber / instructions.md
Last active March 27, 2024 10:52
Ecto migration for renaming table with indexes and constraints

Renaming table in Ecto migration

I recently wanted to rename a model and its postgres table in a Phoenix app. Renaming the table was simple and documented, but the table also had constraints, sequences, and indexes that needed to be updated in order for the Ecto model to be able to rely on default naming conventions. I couldn't find any examples of what this would look like but was eventually able to figure it out. For anyone else in the same situation, hopefully this example helps.

In the example below, I'm renaming the Permission model to Membership. This model belongs to a User and an Account, so it has foreign key constraints that need to be renamed.

defmodule MyApp.Repo.Migrations.RenamePermissionsToMemberships do
  use Ecto.Migration

#Phoenix 1.1.x to 1.2.0 Upgrade Instructions

Project Generator

To generate new projects as 1.2.0, install the new mix archive:

mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Deps

@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.
@edelpero
edelpero / heroku_rails_phantomjs.md
Last active May 10, 2021 08:31
Heroku, Ruby on Rails and PhantomJS

#Heroku, Ruby on Rails and PhantomJS

In this post, I’m going to show you how to modify an existing Ruby on Rails app running on Heroku’s Cedar stack to use PhantomJS for screen scraping. If you’ve never heard of PhantomJS, it’s a command-line WebKit-based browser (that supports JavaScript, cookies, etc.).

Let’s get started. This is a high-level overview of the required steps:

  • Modify your app to use multiple Heroku buildpacks.
  • Extend your app to use both the Ruby as well as the PhantomJS buildpacks.
  • Confirm that everything worked.
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@zenkay
zenkay / gist:3237860
Created August 2, 2012 15:19
Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@eparreno
eparreno / gist:2300165
Created April 4, 2012 10:23
About estimations
P = programmer; NP = non-programmer
NP: How long will it take?
P: It'll take as long as it takes.
NP: I don't understand. What does that mean?
P: When you tell me that the product is finished, it's done.
NP: You mean you can't estimate how long it'll take?
P: I can't estimate when you'll decide that it is done, therefore an
accurate prediction is impossible. From experience I know that a
project like this can take from three to nine months. A lot
@raul
raul / retry_upto.rb
Created October 7, 2011 06:42
retry_upto.rb
# Ruby `retry` with steroids:
#
# - retry up to 5 times without waiting between them and retrying after any exception
#
# retry_upto(5) do ... end
#
# - retry up to 5 times, waiting 2 seconds between retries
#
# retry_upto(5, :wait => 2) do ... end
#
@jpantuso
jpantuso / osx_lion_rail_setup.md
Created July 27, 2011 19:51
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL