Skip to content

Instantly share code, notes, and snippets.

View yurikoval's full-sized avatar
🌴
On an island in the sun

🇺🇦 Yuri Kovalov yurikoval

🌴
On an island in the sun
View GitHub Profile
@yurikoval
yurikoval / keymap.cson
Created August 17, 2017 03:21
Atom custom keybindings
# ~/.atom/keymap.cson
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
@yurikoval
yurikoval / git_setup.sh
Last active July 1, 2020 09:13
Setup git
#!/bin/sh
# http://uberblo.gs/2010/12/git-lol-the-other-git-log
git config --global --add alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit"
git config --global --add alias.lola "log --graph --decorate --pretty=oneline --abbrev-commit --all"
git config --global --add alias.m "merge --no-ff --log"
git config --global --add alias.st "status"
git config --global --add alias.br "branch"
git config --global --add alias.bra "branch --all"
git config --global --add alias.sweep "!git branch --merged master | grep -v 'master$' | xargs git branch -d && git remote prune origin"
@yurikoval
yurikoval / array_finder_benchmark.rb
Created December 6, 2017 07:19
Finding an element using array/hash/set
#!/usr/bin/env ruby
require 'benchmark'
require 'active_support'
require 'active_support/all'
require 'set'
BENCHMARK_TIMES = 1_000_000
def find_array(array, find_me)
array.any?{ |id, sku| id == find_me && sku.present? }
def    
puts "spooky!"
end
   
puts "Indeed!"
@yurikoval
yurikoval / snippets.cson
Created July 30, 2019 10:49
Atom Snippets
'.source.elixir':
'exunit':
'prefix': 'exunit'
'body': 'use ExUnit.Case, async: ${1:true}$2'
'IO.inspect':
'prefix': 'io'
'body': 'IO.inspect(${1:}, label: "${2:inspecting}")$3'
'|> IO.inspect':
'prefix': 'iop'
'body': '|> IO.inspect(label: "${1:inspecting}")$2'
@yurikoval
yurikoval / prototype.sh
Last active April 22, 2023 15:06
Simple script to jumpstart a new Rails app with your favourite gems
#!/bin/bash
# This script accepts one argument, which is the name of the your new project
if [ "$#" -ne 1 ]; then
echo "Usage: $0 generate new rails app"
exit 1
fi
app=$1