Skip to content

Instantly share code, notes, and snippets.

View JacopKane's full-sized avatar

Furkan Tunalı JacopKane

View GitHub Profile
@cobyism
cobyism / gh-pages-deploy.md
Last active March 29, 2024 01:06
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@peterdemartini
peterdemartini / command.sh
Last active March 28, 2024 17:49
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@mihow
mihow / load_dotenv.sh
Last active March 26, 2024 10:48
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@plivox
plivox / auto_switch_theme.py
Last active March 25, 2024 04:03
Automatic iTerm2 preset switching on MacOS
#!/usr/bin/env python3
import asyncio
import iterm2
THEME_LIGHT = "Tango Light"
THEME_DARK = "Tango Dark"
class AutoSwitchTheme:
@dominicthomas
dominicthomas / ffmpeg wav -> mp3
Created October 7, 2014 09:30
Convert a wav to a 320k mp3 using ffmpeg.
ffmpeg -i inputfile.wav -ab 320k outputfile.mp3
@vjt
vjt / copy-from-time-machine.sh
Last active March 8, 2024 17:05
Copy data from a Time Machine volume mounted on a Linux box.
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#
@davisford
davisford / setup-avahi.sh
Created July 12, 2013 14:14
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
@sindresorhus
sindresorhus / post-merge
Last active February 14, 2024 06:20
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@robertkowalski
robertkowalski / npm-registry-licenses.txt
Created November 23, 2013 22:31
The licenses in the npm-registry from their package.json, from the latest version of each module 23.11.2013
The licenses in the npm-registry from their package.json, from the latest version of each module
23.11.2013
[ { key: 'undefined', value: 27785 },
{ key: 'MIT', value: 20811 },
{ key: 'BSD', value: 5240 },
{ key: 'BSD-2-Clause', value: 621 },
{ key: 'Apache 2.0', value: 263 },
{ key: 'GPL', value: 233 },
@jan-warchol
jan-warchol / sync-history.sh
Last active February 4, 2024 04:52
Synchronize history across bash sessions
# Synchronize history between bash sessions
#
# Make history from other terminals available to the current one. However,
# don't mix all histories together - make sure that *all* commands from the
# current session are on top of its history, so that pressing up arrow will
# give you most recent command from this session, not from any session.
#
# Since history is saved on each prompt, this additionally protects it from
# terminal crashes.