Skip to content

Instantly share code, notes, and snippets.

View igorbabko's full-sized avatar
🇺🇦

Igor Babko igorbabko

🇺🇦
View GitHub Profile
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@felipecsl
felipecsl / restart coreaudio daemon
Last active May 17, 2024 22:17
Restart Mac OS X coreaudio daemon. Useful if you cannot change the audio output device to Airplay.
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`
# or...
sudo killall coreaudiod
@barryvdh
barryvdh / _ide_helper.php
Last active May 6, 2024 07:45
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@gig3m
gig3m / Default (OSX).sublime-keymap
Created April 19, 2013 04:41
Sublime Text 2 Vintage Lefty Remap (ijkl movement)
[
{ "keys": ["h"], "command": "enter_insert_mode",
"context":
[
{"key": "setting.command_mode"},
{"key": "selection_empty"}
]
},
{ "keys": ["H"], "command": "enter_insert_mode", "args":
{"insert_command": "vi_move_to_first_non_white_space_character"},
@jolosantos
jolosantos / gist:5898391
Created July 1, 2013 04:39
Remove Indent Guide - Sublime Text
"draw_indent_guides": true
@twolfson
twolfson / README.md
Last active November 13, 2022 07:53
Database column naming conventions

We have been going over a lot of naming conventions for our database. I would like to start recording the ideas and why they work/don't.

Using timestamps for stateful boolean column

This applies to having an archived state of an item. We attempted to draw a line at when a column is an action (e.g. archive) rather than a property (e.g. is_red). This idea means that we convert these "action" states to timestamp fields over booleans (e.g. archived_at: timestamp).

Conclusion

In order to keep data consistent, we must introduce the timestamp from a single service. This means that we must introduce an alternative endpoint to performing this action (e.g. PUT /item/:id/archive). This is fine but can lead to complications with pedantic REST frameworks.

Naming boolean columns

There are a lot of options for column naming:

@unbracketed
unbracketed / branch-fu.md
Created April 7, 2015 17:49
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 15, 2024 03:01
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@JeffreyWay
JeffreyWay / .bash_profile
Created July 31, 2015 19:20
Prettier git logs
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"