Skip to content

Instantly share code, notes, and snippets.

@x1wins
x1wins / schema.rb
Created September 17, 2023 23:01
ahoy, pay gem - schema.rb
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
@josephrexme
josephrexme / notes.sh
Created February 21, 2023 02:28
OPENSSL Ruby Issues (fixing for frum vm)
# With Ruby 2.7.7
# The error:
# OpenSSL 3 - symbol not found in flat namespace '_SSL_get1_peer_certificate'
frum uninstall 2.7.7
frum install 2.7.7 --with-openssl-dir=$(brew --prefix openssl@1.1)
gem install bundler -v 2.2.19 # or whatever the Gemfile.lock bundler version you have is
bundle config build.puma --with-cppflags=-I$(brew --prefix openssl@1.1)/include
bundle install
@ryanorsinger
ryanorsinger / installing_anaconda_on_mac.md
Last active April 21, 2024 00:54
Installing Homebrew and Anaconda

Installing Homebrew and Anaconda on a Mac

Install Homebrew

Run the following command on your terminal to install Homebrew. Homebrew is a package manager for Macs and is used to install useful development tools and software.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Anaconda through Homebrew

  1. Run brew install --cask anaconda to install Anaconda
@ro31337
ro31337 / gist:fde256c19074356e4f847a48f696658c
Last active October 15, 2023 16:59
Bulma font-awesome icons for Rails 6

Единственная запара возникла при подключении иконок к рельс6, решается так (app/javascript/packs/fa.scss)

@import "bulma/bulma";

$fa-font-path: '~@fortawesome/fontawesome-free/webfonts';
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/solid'; // fas prefix
@import '~@fortawesome/fontawesome-free/scss/brands'; // fab prefix
// see https://fontawesome.com/how-to-use/with-the-api/setup/importing-icons for more prefixes
@adamelliotfields
adamelliotfields / docker-compose.yml
Created February 10, 2019 22:39
Docker Compose Mongo with Mongo Express
version: "3.5"
services:
mongo:
image: mongo:latest
container_name: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
ports:
@dgoguerra
dgoguerra / homebrew-dynamodb-local.md
Last active November 5, 2023 11:15
Install dynamodb-local through Homebrew (custom formula)

Install dynamodb-local through Homebrew

An official formula for dynamodb-local existed, but was removed since dynamodb-local is not open source and stopped having versions.

Now its available either through a Cask, or by installing it as a formula from an unofficial tap (third party repo).

When installed as a cask dynamodb-local cannot be exposed as a service, so here we are installing it as a formula. It has been forked from rjcoelho/homebrew-boneyard and updated to be a head-only formula, to avoid checksum erros on new versions. It is available at dgoguerra/homebrew-boneyard.

# dynamodb-local depends on Java 6+

Libuv and libev, two I/O libraries with similar names, recently had the privilege to use both libraries to write something. Now let's talk about my own subjective expression of common and different points.

The topic of high-performance network programming has been discussed. Asynchronous, asynchronous, or asynchronous. Whether it is epoll or kqueue, it is always indispensable to the asynchronous topic.

Libuv is asynchronous, and libev is synchronous multiplexing IO multiplexing.

Libev is a simple encapsulation of system I/O reuse. Basically, it solves the problem of different APIs between epoll and kqueuq. Ensure that programs written using livev's API can run on most *nix platforms. However, the disadvantages of libev are also obvious. Because it basically just encapsulates the Event Library, it is inconvenient to use. For example, accept(3) requires manual setnonblocking after connection. EAGAIN, EWOULDBLOCK, and EINTER need to be detected when reading from a socket. This is a

@mrmartineau
mrmartineau / stimulus.md
Last active April 19, 2024 09:41
Stimulus cheatsheet
@abohannon
abohannon / PrivateRoute.js
Created December 22, 2017 19:23
React/Redux Auth with Private Route Component
import React from 'react';
import { Route, Redirect } from 'react-router-dom';
const PrivateRoute = ({ component: Component, authed, ...rest }) => (
<Route
{...rest}
render={props => (
authed
? <Component {...props} />
: <Redirect to="/login" />
@tterb
tterb / README-badges.md
Last active April 16, 2024 03:21
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release