Skip to content

Instantly share code, notes, and snippets.

View Mayurifag's full-sized avatar
🗨️
I may be slow to respond.

Mayurifag

🗨️
I may be slow to respond.
View GitHub Profile
# Makes git push and creates Merge Request at the same time
# If you follow branch naming convention like "ucp-123/new-authorization", MR title will be "UCP-123 New authorization", which will be cross-linked to Jira
# Make sure to replace "ucp" with your shortcut.
# IMPORTANT PREREQUISITE: to run `git config committer.name <your_gitlab_username>` once, so that it gets used for `make publish!` to assign MR to you
USERNAME := $(shell git config committer.name)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ticket_pattern := ucp-[0-9][0-9][0-9]
TICKET := $(shell git rev-parse --abbrev-ref HEAD | grep -o '$(ticket_pattern)' | tr [:lower:] [:upper:])
Note: this assumes you are using ZSH shell.
## Installation
Install [asdf](https://github.com/asdf-vm/asdf):
```
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
$ echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
anonymous
anonymous / DocsMiner.MD
Created February 1, 2018 21:20
ДоксМайнер мануал

Эта инструкция собрана по крупицам анонов и призвана помочь всем тем, кто не знает как скачивать личные документы из вк. Часто возникает один вопрос:

Можно ли скачивать личные документы конкретного пользователя вк?

Да, можно и нужно. Читай подробнее инструкцию и поймешь как это сделать.

Поиск документов

  1. Заходим на vk.com/docs
@cryzed
cryzed / fix-infinality.md
Last active June 24, 2024 02:24
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

Realtime Notifications with ActionCable

In this episode we're going to be adding realtime notifications into your app using ActionCable. We've talked about notifications a few times in the past and we used AJAX polling for that. 95% of the time, polling is the solution that would be recommended for it.

But if you're looking for a good introduction into ActionCable then this is a decent one because we're only really using it for one way from the server side to the client side.

Getting started

So to get started we're starting with an app that has Bootstrap installed and then we created a Main controller with an index view which is where we will list our Notifications as for this example.

Before we generate our channels let's install a few things

@nepsilon
nepsilon / git-change-commit-messages.md
Last active June 2, 2024 23:31
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@mdang
mdang / RAILS_CHEATSHEET.md
Last active July 17, 2024 05:52
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

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

@watson
watson / README.md
Last active July 13, 2023 22:42
A list of search and replace unix commands to help make a node repository 'standard' compliant

The standard code style linter is a great tool by Feross - check it out!

Remove trailing semicolons:

find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/;$//' {} \;

Ensure space between function and opening bracket:

@brianburridge
brianburridge / gist:8d2755a73dd5b4f0332b
Created December 10, 2014 19:47
Export local db to JSON
namespace :json do
desc "Export all data to JSON files"
task :export => :environment do
Rails.application.eager_load!
ActiveRecord::Base.descendants.each do |model|
file = File.open(File.join(Rails.root, "db", "export", "#{model.table_name}.json"), 'w')
file.write model.all.to_json
file.close
end
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do