Skip to content

Instantly share code, notes, and snippets.

@Anderson-Juhasc
Anderson-Juhasc / vim-auto-compile-less
Created December 5, 2011 11:06
Auto compile lesscss with VIM
" Less compile
autocmd FileWritePost,BufWritePost *.less :call LessCSSCompress()
function! LessCSSCompress()
let cwd = expand('<afile>:p:h')
let name = expand('<afile>:t:r')
if (executable('lessc'))
cal system('lessc '.cwd.'/'.name.'.less > '.cwd.'/'.name.'.css &')
endif
endfunction
@yasith
yasith / gist:1508312
Created December 22, 2011 00:11
solarized fix for .vimrc
set t_Co=256
set background=dark
if !has('gui_running')
let g:solarized_termcolors=&t_Co
let g:solarized_termtrans=1
endif
colorscheme solarized
@felipecsl
felipecsl / restart coreaudio daemon
Last active July 20, 2024 22:56
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
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@salcode
salcode / .gitignore
Last active July 10, 2024 14:28
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@KhanMaytok
KhanMaytok / functions.php
Created June 26, 2015 14:44
Get Editor capanilities to manage users
/*
* Let Editors manage users, and run this only once.
*/
function isa_editor_manage_users() {
if ( get_option( 'isa_add_cap_editor_once' ) != 'done' ) {
// let editor manage users
$edit_editor = get_role('editor'); // Get the user role
@rraallvv
rraallvv / resample-psi.sh
Created January 27, 2016 12:34
Resample images to 72 DPI using sips
#!/bin/bash
if [[ ! "$1" || "$1" == "-h" || "$1" == "--help" ]]; then cat <<HELP
Resample specified images to 72 DPI
http://benalman.com/
Usage: $(basename "$0") [img [img ...]]
The new MacBook Pro retina display is amazing, but screengrabs taken on
one using the screencapture utility aren't scaled to 72 DPI by default.
This script scales those images to 72 DPI, making them viewable at a sane
resolution in web browsers.
@dust321
dust321 / arch-linux-install-encryption
Last active April 2, 2021 23:43 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing Arch Linux on an DOS/BIOS system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system, for BIOS. Dustin dut n ex 5 a t g ma il
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
@poliquin
poliquin / open_finder_in_iterm.applescript
Created April 15, 2016 16:30
Launch iTerm2 window from Finder using AppleScript
-- Open new iTerm2 window and navigate to current Finder directory
-- Requires iTerm2 version 2.9+
(* Install:
*
* (1) Save this script as an Application
* (2) Cmd + drag the application to Finder toolbar
* (3) Click the new shortcut to open iTerm2 window in current directory
*)
@develmaycare
develmaycare / duplicate-row.js
Last active July 20, 2024 15:10
Duplicate a row in Google Sheets.
/* To use this in a Google Sheet:
1. Go to Tools > Script Editor.
2. Save the script.
3. Paste this script and click on the bug symbol.
4. Authorize the script.
5. Refresh the sheet.
*/
// global
var ss = SpreadsheetApp.getActive();