Skip to content

Instantly share code, notes, and snippets.

@JohnDinhDev
JohnDinhDev / Reset Udemy Progress.md
Last active April 29, 2024 18:36
Reset Udemy Progress

Reset Udemy Progress

Last Updated: 09/30/2022

Step 1. Go to Udemy course in browser

Go to the course and have any video up. The following code relies on the right sidebar to be visible to uncheck all your progress.

Step 2. Open browser console

You can do this with ctrl+shift+j and making sure the console tab is selected for chrome/brave

@dmarchuk
dmarchuk / migrations.md
Created October 27, 2020 12:40 — forked from majackson/migrations.md
Django migrations without downtime

Django Migrations without Downtime

The following instructions describe a set of processes allowing you to run Django database migrations against a production database without having to bring the web service down.

Note that in the below instructions, migrations are all run manually at explicit points, and are not an automatic part of the deployment process.

Adding Fields or Tables

Adding a (nullable) field or a new table

  1. Make the model or column addition in your code.
@camertron
camertron / enumerable.py
Created July 21, 2020 17:09
Python implementation of Ruby's enumerable module
import unittest
def enum(obj):
if type(obj) == list:
return EnumList(obj)
elif type(obj) == dict:
return EnumDict(obj)
class Enumerable(object):
def each(self, cb):
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active May 15, 2024 20:55
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@AkhileshNS
AkhileshNS / History|-101b87f5|entries.json
Last active January 19, 2023 20:01
A gist containing my vscode settings
{"version":1,"resource":"file:///c%3A/_WORKING/Development/DATA%20INTENSIVE%20SYSTEMS/a3-AkhileshNS/src/server.ts","entries":[{"id":"DgZJ.ts","timestamp":1650304331152},{"id":"6yBg.ts","timestamp":1650304566422},{"id":"gM4P.ts","timestamp":1650304603067},{"id":"EWvr.ts","timestamp":1650315339108},{"id":"t8S2.ts","timestamp":1650315386367}]}
@tejasbubane
tejasbubane / with_lock_spec.rb
Created March 26, 2019 15:28
Testing with_lock activerecord
# For stackoverflow question: https://stackoverflow.com/questions/55339129/how-to-test-lock-mechanism
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@dlaehnemann
dlaehnemann / contribute_github_without_write_access.md
Last active May 1, 2024 13:32
contributing to github repo without write access: pull from origin repo, push to your own fork

Whenever I want to create pull requests to a repo that I don't have write access to, I:

  1. Fork the original repo to my account.
  2. Clone the original repo to my local machine.
  3. Add my fork as an additional remote and make it the push default.
  4. Make changes in a new branch locally.
  5. Push this branch to my fork.
  6. Create a pull request from there.
@fnky
fnky / ANSI.md
Last active May 19, 2024 16:37
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@YumaInaura
YumaInaura / VIM.md
Last active November 25, 2021 15:42
Vim—Edit clipboard text directly ( Example using Mac OS pbcopy / pbpaste )

Vim—Edit clipboard text directly ( Example using Mac OS pbcopy / pbpaste commands )

Ease way

Put blow line in your rc file ( e.g ~/.bashrc ~/.zshrc )

Restart your shell and hit pbvim.

function pbvim (){
@heroheman
heroheman / ranger-cheatsheet.md
Last active May 11, 2024 17:18
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts