Skip to content

Instantly share code, notes, and snippets.

View gorka's full-sized avatar
🏠
Working from home

Gorka gorka

🏠
Working from home
  • Chicago
  • 14:44 (UTC -05:00)
View GitHub Profile
@dhh
dhh / linux-setup.sh
Last active May 24, 2024 06:35
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl fzf eza \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@mattantonelli
mattantonelli / discord_interactions_webhook_rails.md
Created December 16, 2020 18:33
Discord interactions webhook implementation for Ruby on Rails

app/controllers/discord_controller.rb

class DiscordController < ApplicationController
  skip_before_action :verify_authenticity_token

  def interactions
    # Request signature verification
    begin
      verify_request!
 rescue Ed25519::VerifyError

List of companies using Ruby on Rails

  • figma.com
  • tesla.com (Tesla motors)
  • meetup.com
  • dribbble.com
  • fiverr.com
  • basecamp.com
  • notonthehighstreet.com
  • goodreads.com

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

The 5-minute backpack demo

Here's what I carry in a Tom Bihn Synapse 19 bag when I travel for 1-to-n days. In general, I optimize for low-weight items, with a secondary focus on reducing maintenance. You can peruse a gallery of pictures, too.

Clothing

@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active May 10, 2024 04:36
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.

Example:

# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com
@iscott
iscott / simple_authentication_rails_5_bcrypt_and_has_secure_password.md
Last active May 22, 2024 08:00
Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password

Cheat Sheet: Simple Authentication in Rails 6 with has_secure_password

The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.

First the simplest/core layers, then optional layers depending on which features/functionality you want.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6
@javivelasco
javivelasco / reactive-2016.md
Last active January 10, 2023 19:45
Proposal for lightning talk at Reactive Conf 2016

Please star ⭐️ the gist to help! This is a proposal for a ⚡️ talk at Reactive Conference.

Styling Components in React Toolbox 2

I wrote react-toolbox and presented it almost a year ago in lighning talk at Reactive Conf 2015 in Bratislava. At first it was just a proof of concept of a component library styled with CSS Modules and SASS. Now the project has grown quite a bit, and during this year there has been tons of changes and lessons learned.

Theming and customization is one of the most difficult and interesting problems to solve. For the first version we needed a custom Webpack loader to generate themes and doing simple style overrides was very painful. Today I'm working on a new playground that will allow you try CSS Modules live, and to create React Toolbox themes on the f

@nizaroni
nizaroni / rails-glossary.md
Created February 3, 2015 15:50
Glossary of Rails terms for beginners.

Rails Glossary

A glossary of Rails terms for beginners.

Router

The router is the component of Rails that takes your config/routes.rb file, reads your routes from it and uses them to respond to incoming requests.

@kirillzubovsky
kirillzubovsky / How to delete all tweets with Ruby fast
Last active July 4, 2023 07:39
A quick way to delete all your tweets using Twitter archive and a ruby script.
require 'twitter'
require "json"
USERNAME = 'YOUR_TWITTER_USER_NAME'
ARCHIVE_PATH = 'archive/data/js/tweets'
client = Twitter::REST::Client.new do |config|
config.consumer_key = 'TWITTER_APP_API_KEY'
config.consumer_secret = 'TWITTER_APP_API_SECRET'
config.access_token = 'TWITTER_APP_ACCESS_TOKEN'