Skip to content

Instantly share code, notes, and snippets.

View inem's full-sized avatar
🌰
In progress

Ivan Nemytchenko inem

🌰
In progress
View GitHub Profile
@checco
checco / rw_ro_access.sql
Last active March 22, 2024 08:32 — forked from oinopion/read-access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
--
-- Read only
--
-- Create a group
CREATE ROLE postgres_ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group;
@edtsech
edtsech / lightning_talk_proposal.md
Last active January 31, 2023 07:29
Combining snapshot testing and component library -- ReactiveConf 2017 talk proposal

This is a proposal for a lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal!

Combining snapshot testing and component library

Do you test presentational logic of your components? No? Yes, but you feel like you are writing a lot of dummy tests? You even probably use snapshot tests for that, but don't feel like you make enought value from them..

If so, click 🌟 button on that Gist!

I'll talk how our team is using snapshot testing to iterate faster,

@jimpick
jimpick / Dockerfile
Created June 24, 2017 02:54
Hosting dathttpd on now.sh - https://dat.jimpick.com/
FROM ubuntu:16.04
RUN apt-get update --yes && apt-get upgrade --yes
RUN apt-get update --yes && apt-get upgrade --yes
RUN apt-get -y install curl
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
RUN apt-get -y install ffmpeg zlib1g-dev automake autoconf git \
@iscott
iscott / simple_authentication_rails_5_bcrypt_and_has_secure_password.md
Last active March 15, 2024 03:23
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
@schrader
schrader / Copy Classic Link (Evernote).scpt
Last active July 22, 2019 13:15 — forked from JMichaelTX/Copy EN Note Link (Classic) AS.applescript
Evernote Mac - Put Classic Note Link on Clipboard -- AppleScript
@andrewhaines
andrewhaines / analyticsreportingv4.rb
Last active July 6, 2023 08:50
Using Google Analytics Reporting API v4 in Rails with Oauth2
# This summary shows how to set up a basic request to Google's Analytics Reporting API v4 from a Rails app.
# Gemfile
gem 'google-api-client', # v. 0.11
gem 'omniauth-google-oauth2' # v. 0.4.1 with Devise
# In a model or controller somewhere...
analytics = Google::Apis::AnalyticsreportingV4::AnalyticsReportingService.new
analytics.authorization = current_user.token # See: https://github.com/zquestz/omniauth-google-oauth2
@oubiwann
oubiwann / appify.sh
Last active April 29, 2023 10:32 — forked from advorak/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
#!/usr/bin/env bash
VERSION=4.0.1
SCRIPT=`basename "$0"`
APPNAME="My App"
APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"
OSX_VERSION=`sw_vers -productVersion`
PWD=`pwd`
function usage {
@davidkryzaniak
davidkryzaniak / lightsail-docker.sh
Created December 3, 2016 04:52
Auto-Install Docker on AWS Lightsail
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install -y docker-engine
sudo service docker start
sudo docker pull php:5.6-apache
@wojteklu
wojteklu / clean_code.md
Last active May 5, 2024 06:16
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@inexorabletash
inexorabletash / @ IndexedDB Full Text Search (Proof of Concept).md
Last active March 19, 2024 13:08
IndexedDB Full Text Search (Proof of Concept)

This demonstrates the implementation of full text search for documents in Indexed DB.

  • Word-breaking and stemming is used to create a list of terms for each document.
  • Document records are annotated with the list of terms when added to the database.
  • A multi-entry index on the list of terms is populated.
  • A query is similarly processed into a list of terms.
  • A join over the terms is implemented using multiple cursors on the index.

The necessity of annotating records with the word list to populate the index is a limitation of the current Indexed DB API. A feature request to support custom