Skip to content

Instantly share code, notes, and snippets.

View gingray's full-sized avatar
🎯
Focusing

Ivan gingray

🎯
Focusing
View GitHub Profile
@gingray
gingray / git_bisect_examle.md
Last active December 4, 2019 15:14
git bisect example
git bisect start
git bisect good 60caac5
git bisect bad fba59ff34722b9b4ee0bcd6c0f9a1873f57345d4
git bisect run ruby check.rb
if File.open('/Users/gingray/github/ideavim/resources/META-INF/plugin.xml').read() =~ /VimWindowClose/
 exit(0)
@gingray
gingray / rails_init.md
Last active February 9, 2020 18:17
Rails new options
rails new test-angular --database=postgresql -T --webpack=angular
rails new test-angular --database=postgresql -T --webpack=react
@gingray
gingray / gdb_for_mac_osx.md
Created July 8, 2019 09:33
Tune GDB for Mac OS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@gingray
gingray / udp_go.go
Created February 16, 2019 12:38
udp go
ServerAddr, _ := net.ResolveUDPAddr("udp", fmt.Sprintf(":%d", port))
serverConn, _ := net.ListenUDP("udp", ServerAddr)
fmt.Println("Server start")
defer func() {
_= serverConn.Close()
}()
buf := make([]byte, 1024)
@gingray
gingray / bench.rb
Created January 18, 2019 15:44 — forked from JoshTGreenwood/bench.rb
Benchmark break vs. catch-throw vs. begin-rescue-end in ruby
require 'benchmark'
Benchmark.bmbm do |x|
x.report('Break') do
1_000_000.times do
break
end
end
@gingray
gingray / actionlist.vim
Created January 15, 2019 09:55 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@gingray
gingray / karabiner.json
Created November 29, 2018 16:20
karabiner
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@gingray
gingray / emacs.lsp
Created November 29, 2018 14:45
spacemacs config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory