Skip to content

Instantly share code, notes, and snippets.

View pandwoter's full-sized avatar
🙃
digging CS

Alexander Samchuk pandwoter

🙃
digging CS
  • Tbilisi, Georgia
View GitHub Profile
@akaihola
akaihola / nixos-x1.rst
Last active September 12, 2024 14:04
Installing NixOS on a Lenovo ThinkPad Carbon X1 Gen 9
@alexshagov
alexshagov / database_changes_logger.rb
Created May 11, 2020 14:52
Ruby on Rails: database changes logger
# frozen_string_literal: true
### Usage
# Helps to understand how operation run affects the database state
# DatabaseChangesLogger.call(filename: 'output') { Operation.perform }
module DatabaseChangesLogger
EVENTS_TYPE = 'sql.active_record'
OPERATION_REGEX = /Update|Create/.freeze
@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active February 7, 2024 19:19
Install mysql2 on MacOS Mojave

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@abhionlyone
abhionlyone / Capfile
Last active April 20, 2022 19:53
create-react-app with capistrano for automated deployments
require "capistrano/setup"
require "capistrano/deploy"
require "capistrano/scm/git"
require 'capistrano/npm'
install_plugin Capistrano::SCM::Git
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
@joemusacchia
joemusacchia / ReactCarrierwaveImageUploadBlogPost.md
Last active February 7, 2022 02:46
Upload images with React and the carrierwave Ruby gem for Rails 5

Upload images with React and the carrierwave Ruby gem for Rails 5

I recently attended a 4.5 month, intensive coding bootcamp in Boston, MA called Launch Academy. I spent a lot of time in academic science doing imaging research, so I naturally had an interest in learning how to manipulate images in this new web browser environment. For my capstone project, I created a very simple image editing Rails app where I realized I needed to be able to save/upload images to my database.

Since, through earnest effort, I wanted my app to use React for a single-page experience, and I quickly discovered that my desire to use a React/fetch/carrierwave/fog/Rails strategy was initially difficult to learn. I had to pull information from many sources (StackOverflow, Medium, official docs, other blog posts, course instructors, etc) to develop a method that uses this specific POSTing cycle.

This blog post represents my findings to integrate all these technologies in a modern, seamless

@ibraheem4
ibraheem4 / postgres-brew.md
Last active September 13, 2024 11:16 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@anvk
anvk / psql_useful_stat_queries.sql
Last active July 12, 2024 11:28
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@nikhita
nikhita / update-golang.md
Last active September 20, 2024 13:10
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@przbadu
przbadu / Ctags.md
Last active September 10, 2024 18:08
Ctags for ruby on rails and node applications

Install ctags

http://ctags.sourceforge.net follow this url for installation and documentation.

Ctags with Ruby/Rails

We can ctags lots of programming languages. Here is how to do it for ruby/rails. I really like how RubyMine jumps to the source code (either withing project score or to the gem source). This is really useful for reading source code for those classes, methods, modules etc. But Now that I use vim as My IDE/Editor I really like that functionality to happen in my vim editor. And I found ctags as the solution.

@keyserfaty
keyserfaty / nightwatch-react.md
Last active July 27, 2022 20:32
How to write a simple `Nightwatch` test for a `React` app?

How to write a simple Nightwatch test for a React app?

Nightwatch is a testing tool made in Node and Selenium to test browser apps. Long story short you can set it to navigate (really, truly, navigate) your site to test it as if it was a real person.

After you setup your environment, add your tests and run them Nightwatch will open a browser and start interacting with your site in realtime (you can see the whole thing). It will starting clicking around based on what you told it it should click and test if it encounters what you told it it should encounter.

Ok, so lets get to it!

I'm not gonna focus much in the setting up process (I'm much more interested in the API and the use cases) but this is a summary of what you should do in Mac: (full instructions in the Nightwatch website)