Skip to content

Instantly share code, notes, and snippets.

@mkubenka
mkubenka / sparsecheckout.yml
Created December 1, 2018 17:43
Ansible Sparse Checkout
---
- hosts: all
vars:
repo_url: ssh://[email protected]/user/repo.git
base_dir: /var/www
sparse_checkout:
- folder1
@wronk
wronk / python_environment_setup.md
Last active April 10, 2025 22:25
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview of Python Virtual Environments

This guide is targetted at intermediate or expert users who want low-level control over their Python environments.

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.


h/t @sharkinsspatial for linking me to the perfect cartoon

@yangxuan8282
yangxuan8282 / emoji-info.sh
Last active January 24, 2025 18:39
Emoji❤bash
#!/bin/bash
# run this scripts with `bash emoji-info.sh` or `./emoji-info.sh`
usage() {
cat << EOF
usage: $0 [options] <emoji>
Options:
-h Show this message
-o Octal Escape Sequence
@SkaTeMasTer
SkaTeMasTer / log-rotate
Created February 13, 2017 08:51
Log rotate is important to keep the SD cards on Raspberry pi from corruption, disable any logging when possible (after debugging)
Logfile RoATING file operations using UNIX logrotate utility.
=============================================
+ Rotate the log file when file size reaches a specific size
+ Continue to write the log information to the newly created file after rotating the old log file
+ Compress the rotated log files
+ Specify compression option for the rotated log files
+ Rotate the old log files with the date in the filename
+ Execute custom shell scripts immediately after log rotation
+ Remove older rotated log files
@subfuzion
subfuzion / curl.md
Last active April 13, 2025 10:00
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@fareh
fareh / Santander_.gitignore
Created September 15, 2015 22:25
feature/stn-290
# Created by https://www.gitignore.io
### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
*.iml
## Directory-based project format:
.idea/
@tommyvdv
tommyvdv / feature-ckeditor-no-dimension-styles-inline.patch
Last active August 29, 2015 14:12
Forkcms fix: Unminified version of image plugin. The backend ckeditor no longer suggests image width and height automatically when inserting an image. Additionally the inline-styles for the set width and height are replaced by element attributes.
From bcb9a6feb17294e86692a08afcaeaab50196efd3 Mon Sep 17 00:00:00 2001
From: Tommy Van de Velde <[email protected]>
Date: Fri, 23 Jan 2015 09:24:35 +0100
Subject: [PATCH] no more auto-sizes or inline styles upon inserting an image
in an editor
---
src/Backend/Core/Js/backend.js | 48 +-
.../Js/ckeditor/plugins/image/dialogs/image.js | 1424 +++++++++++++++++++-
2 files changed, 1456 insertions(+), 16 deletions(-)
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active May 11, 2024 17:43
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@vratiu
vratiu / .bash_aliases
Last active April 14, 2025 13:03
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@mathiasverraes
mathiasverraes / TestFrameworkInATweet.php
Last active September 24, 2024 14:47
A unit testing framework in a tweet.
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}