Skip to content

Instantly share code, notes, and snippets.

View ykocaman's full-sized avatar

ykocaman ykocaman

  • istanbul
View GitHub Profile
@noniq
noniq / capistrano_rsync.rb
Created August 30, 2017 16:46
Simple plugin for Capistrano 3.7+ to deploy via rsync
require 'capistrano/scm/plugin'
class Capistrano::SCM
# Usage: Add this to your `Capfile`:
#
# require_relative "lib/capistrano_rsync" # adapt path as needed
# install_plugin Capistrano::SCM::Rsync
#
# Note that this you need to deactivate any other SCM plugins (there can only be one SCM plugin active at any time)-
#
@ahmetb
ahmetb / gcrgc.sh
Last active May 10, 2024 15:17
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@keithmorris
keithmorris / drive-format-ubuntu.md
Last active June 25, 2024 04:08
Partition, format, and mount a drive on Ubuntu
@taylorotwell
taylorotwell / weather.sh
Last active August 27, 2019 13:40
Weather CLI
alias weather='curl -s wttr.in | sed -n "1,7p"'
@ChrisTimperley
ChrisTimperley / installing-arch.md
Last active December 1, 2023 17:25
Instructions for installing Arch Linux and i3 onto a Dell Inspiron 7537

Arch Linux

GRUB Installation

Be sure to replace /dev/sda with the name of the drive (n.b. not the partition) containing Arch.

# pacman -S grub-bios intel-ucode
# grub-install /dev/sda
# mkinitcpio -p linux
@wojteklu
wojteklu / clean_code.md
Last active June 29, 2024 08:22
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

@augbog
augbog / Free O'Reilly Books.md
Last active May 14, 2024 10:27
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@hakobe
hakobe / client.go
Created September 23, 2016 16:33
golang unix domain socket
package main
import (
"io"
"log"
"net"
"time"
)
func reader(r io.Reader) {
@sg-s
sg-s / automatic-version-numbers.md
Last active March 3, 2024 10:07
Automatic version numbers of your git repository using git hooks

Put this in a file called pre-commit in .git/hooks/

#!/bin/sh
# To enable this hook, rename this file to "pre-commit".

git rev-list --count master > build_number
git add build_number
@ankurk91
ankurk91 / xdebug-mac.md
Last active March 9, 2024 22:20
php xDebug v3 on Ubuntu/Mac and phpStorm

🪲 Install and Configure xDebug v3 on MacOS for PhpStorm 🐘

  • Assuming that you have already installed php and apache via Homebrew

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache

pecl install xdebug