Skip to content

Instantly share code, notes, and snippets.

View souzagab's full-sized avatar
:shipit:

Gabriel S. souzagab

:shipit:
View GitHub Profile
@kesor
kesor / component-app.js
Last active April 23, 2024 15:18
Vue.js 3.x with ES6 modules in the browser using import-map
import { defineAsyncComponent } from 'vue'
const Content = defineAsyncComponent(() => import('./component-content.js'))
export default {
name: 'App',
components: { Content },
template: /*html*/`
<Content />
`
@JerryLokjianming
JerryLokjianming / Crack Sublime Text Windows and Linux.md
Last active May 9, 2024 23:20
Crack Sublime Text 3.2.2 Build 3211 and Sublime Text 4 Alpha 4098 with Hex

How to Crack Sublime Text 3.2.2 Build 3211 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 3.2.2 Build 3211
  2. Visit https://hexed.it/
  3. Open file select sublime_text.exe
  4. Offset 0x8545: Original 84 -> 85
  5. Offset 0x08FF19: Original 75 -> EB
  6. Offset 0x1932C7: Original 75 -> 74 (remove UNREGISTERED in title bar, so no need to use a license)

Improving heat management after macbookpro 2011 discrete GPU fix, also a script to automate part of the fix process

Taken from StackExchange

Thanks to LangLangC

NOTE: This is experimental; works for some people, not for others

Improved thermal and power management

@maxivak
maxivak / webpacker_rails.md
Last active April 13, 2023 18:46
Webpack, Yarn, Npm in Rails
@dommmel
dommmel / blob_authenticatable.rb
Last active July 12, 2023 01:01
Devise authentication for Rails' ActiveStorage
# Rails controller concern to enable Devise authentication for ActiveStorage.
# Put it in +app/controllers/concerns/blob_authenticatable.rb+ and include it when overriding
# +ActiveStorage::BlobsController+ and +ActiveStorage::RepresentationsController+.
#
# Optional configuration:
#
# Set the model that includes devise's database_authenticatable.
# Defaults to Devise.default_scope which defaults to the first
# devise role declared in your routes (usually :user)
#
@blackgate
blackgate / mbp2011-disable-amd-gpu.md
Last active November 22, 2023 01:23
Macbook Pro 2011 - Disable AMD GPU
@cdesch
cdesch / rails_generator_cheat_sheet.md
Last active March 30, 2024 09:07
Rails Generator CheatSheet

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

@mdang
mdang / RAILS_CHEATSHEET.md
Last active May 8, 2024 01:01
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@kelvinst
kelvinst / ruby-meta.md
Last active August 7, 2023 20:49
Metaprogramanção em ruby - o básico

Metaprogramanção em ruby - o básico

Bem, se você é um programador há algum tempo já deve ter ouvido falar sobre metaprogramação. Eu sei, dá três tipos de arrepio só de ouvir o termo. E sim, é uma coisa bem cabeluda, é um recurso muito poderoso e muitas vezes difícil de entender. Mas agora seus problemas acabaram 👍 👍! Vou explicar pra vocês o que é metaprogramação e como fazer isso em ruby!

O que é?

Certo, sobre o termo e o conceito então: metaprogramação é um termo usado para definir um programa, ou uma rotina, que manipula o próprio programa (ou outro, tanto faz) em tempo de execução. Ou seja, um programa que programa. É basicamente um código que permite alterar e criar mais código ao ser executado.

Se você pensar bem sobre esta teoria é bem fácil elencar um metaprograma certo? Consegue adivinhar um tipo de metaprograma que você usa no seu dia a dia? Isso mesmo! Compiladores são metaprogramas! Você deve estar pensando: "Ah, mas um compilar não altera o próprio código, ele só gera nov