Skip to content

Instantly share code, notes, and snippets.

@Mic92
Mic92 / PKGBUILD
Last active August 29, 2015 14:10
git-extras PKGBUILD
# Maintainer: Stefan Tatschner <stefan.tatschner@gmail.com>
pkgname=git-extras
pkgver=2.2.0
pkgrel=1
pkgdesc="GIT utilities -- repo summary, commit counting, repl, changelog population and more"
arch=(any)
url="http://github.com/visionmedia/git-extras"
license=('custom:MIT')
depends=('git' 'bash')
source="https://github.com/visionmedia/${pkgname}/archive/${pkgver}.tar.gz"
@arenevier
arenevier / mail.vim
Created August 12, 2011 14:12
autodetect email language to set correct spellang in vim
" strip email headers; otherwise, guess would be biased toward english
" put it in ~/.vim/ftplugin/mail.vim
function s:streapHeaders()
let l:headersend = 0
let l:result = []
for l:line in getline(1, '$')
if len(l:line) == 0
let l:headersend = 1
elseif l:headersend
# install fsarchiver
# In Fedora/RedHat system's :: yum install fsarchiver sfdisk dd
# In Debian/Ubuntu System :: apt-get install fsarchiver sfdisk dd
DEVICE_TO_BACKUP=/dev/sdb # assuming /dev/sda is where you have booted ur primary OS
mkdir ./backup_with_fsarchiver # create a directory
cd ./backup_with_fsarchiver # enter into newly created directory
# only get the first 512 bytes # read mbr in wiki for more details
dd if=$DEVICE_TO_BACKUP of=mbr count=1 bs=512
sfdisk -d $DEVICE_TO_BACKUP > partition.sfdisk
@adam-stokes
adam-stokes / bobobogo.lua
Created June 11, 2013 17:14
Using imapfilter to pipe messages through bogofilter
all = myserver.INBOX:select_all()
spam = Set {}
unsure = Set {}
for _, mesg in ipairs(all) do
mbox, uid = unpack(mesg)
text = mbox[uid]:fetch_message()
flag = pipe_to('bogofilter', text)
if (flag == 0) then
table.insert(spam, mesg)
elseif (flag == 2) then
@ilkka
ilkka / fix-outlook-quoting.rb
Created January 31, 2011 12:29
This script is a text filter to correctly quote e-mail messages mangled by Outlook.
#!/usr/bin/env ruby
# Fix outlook quoting. Inspired by perl original by Kevin D. Clark.
# This program is meant to be used as a text filter. It reads a plaintext
# outlook-formatted email and fixes the quoting to the "internet style",
# so that::
#
# -----Original Message-----
# [from-header]: Blah blah
# [timestamp-header]: day month etc
# [...]
@TiagoSantos81
TiagoSantos81 / PortugueseAccentuationRule
Last active November 21, 2016 00:54
Portuguese missing acentuation rule
# Conversion from LanguageTool rule for Catalan (@created by Jaume Ortolà) with wordlist provided by Enno @Konkekt
.../java/org/languagetool/language/Portuguese.java | 3 +-
.../rules/pt/PortugueseAccentuationCheckRule.java | 370 ++++++++++++
.../rules/pt/PortugueseAccentuationDataLoader.java | 61 ++
.../org/languagetool/rules/pt/PortugueseRule.java | 30 +
.../rules/pt/verbos_sem_acento_adj_com_acento.txt | 358 +++++++++++
.../pt/verbos_sem_acento_nomes_com_acento.txt | 666 +++++++++++++++++++++
6 files changed, 1487 insertions(+), 1 deletion(-)
diff --git a/languagetool-language-modules/pt/src/main/java/org/languagetool/language/Portuguese.java b/languagetool-language-modules/pt/src/main/java/org/languagetool/language/Portuguese.java
@ValdikSS
ValdikSS / gist:d896cebd8e1aafc65b4b
Created July 19, 2014 11:52
thermald config for x220
<?xml version="1.0"?>
<!--
use "man thermal-conf.xml" for details
-->
<!-- BEGIN -->
<ThermalConfiguration>
<Platform>
<Name>Lenovo ThinkPad X220</Name>
<ProductName>*</ProductName>
<Preference>QUIET</Preference>
@tobynet
tobynet / install-peco.sh
Created July 10, 2014 06:43
Install latest peco binary for Linux amd64 from https://github.com/peco/peco/releases/latest
#!/usr/bin/env bash
# Usage: BINDIR=$HOME/bin/ bash install-peco.sh
set -o xtrace # for debug output. ( abbr. set -x )
set -o errexit # for exit on error. ( abbr. set -e )
set -o pipefail # errexit for pipe
set -o nounset # exit when the script to use undeclared variables (abbr. set -u)
filename=peco_linux_amd64.tar.gz
latest_tag="$(curl -L --head https://github.com/peco/peco/releases/latest | grep -i location: | sed 's/^.*\/tag\/\([^\/]*\)\r$/\1/')"
@jcyamo
jcyamo / i3-exit
Last active October 9, 2020 10:26
Exit script for the i3 window manager based off of exit script from CrunchBang Linux.
#!/usr/bin/env python
# based on cb-exit used in CrunchBang Linux <http://crunchbanglinux.org/>
import pygtk
pygtk.require('2.0')
import gtk
import os
import getpass
@randy909
randy909 / CapsLockCtrlEscape.ahk
Last active January 2, 2021 09:44 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own, and Ctrl when used in combination with another key, à la Steve Losh. Adapted from the one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281).
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}