Skip to content

Instantly share code, notes, and snippets.

View asukharev's full-sized avatar

Alexander Sukharev asukharev

View GitHub Profile
@mbadran
mbadran / gist:130469
Created June 16, 2009 01:30
replace cd in bash to (silent) pushd
alias cd="pushd $@ > /dev/null"
@miikka
miikka / Simple.hs
Created August 24, 2010 19:07
Simple Haskell Twitter OAuth example
{-# LANGUAGE PackageImports #-}
{-
You need to register your Twitter application at <http://dev.twitter.com/>
to get the consumer key and secret needed for OAuth. When connecting to
Twitter for the first time, do this:
let consumer = Consumer "consumer key" "consumer secret"
token <- authenticate
@jpwatts
jpwatts / xcode-git-version.sh
Created May 11, 2011 16:42
This Xcode 4 build phase script automatically sets the version and short version string of an application bundle based on information from the containing Git repository.
#!/bin/bash
# This script automatically sets the version and short version string of
# an Xcode project from the Git repository containing the project.
#
# To use this script in Xcode 4, add the contents to a "Run Script" build
# phase for your application target.
set -o errexit
set -o nounset
@gruber
gruber / gist:1063605
Created July 4, 2011 16:48
Simple Inbox Archiving Script for Apple Mail
-- See article here: http://daringfireball.net/2007/07/simple_inbox_sweeper
-- The following should be one long line:
set _description to "All unflagged, read messages in each IMAP account
inbox will be moved to the “Archive” mailbox corresponding to that
account. This action is not undoable."
tell application "Mail"
display alert "Archive read messages from IMAP inboxes?" buttons ¬
{"Cancel", "Archive"} cancel button 1 message _description
@qzchenwl
qzchenwl / OAuth2.hs
Created April 10, 2012 12:34
Simple oauth2.0 implementation in Haskell
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
import Data.Aeson
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import Data.ByteString.Lazy (toChunks)
import Data.List
import Data.Maybe
import Data.Typeable (Typeable)
@andrewgarn
andrewgarn / XcodeScripts.sh
Created April 17, 2012 13:58
Xcode 4 Build Version Scripts
# Run script to increase CFBundleVersion by 1 each time a build is archived under release or adhoc
#!/bin/sh
if [ "$CONFIGURATION" == Adhoc || "$CONFIGURATION" == Release ]; then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
fi
# Run script to set CFBundleVersion to local latest git commit hash
@kluivers
kluivers / BuildRule.sh
Created May 21, 2012 22:51
Xcode build rule for Mardown files
# Template file with replacement tag: ${BODY}
TEMPLATE="${SRCROOT}/ShapeDemo/Template.html"
# generate and clean HTML
HTML_CONTENTS=`/usr/local/bin/markdown "${INPUT_FILE_PATH}"`
HTML_CONTENTS=`echo $HTML_CONTENTS | sed -e 's/[\/&]/\\\&/g'`
# replace into template and write to Resources
cat "$TEMPLATE" | sed "s/\${BODY}/${HTML_CONTENTS}/" > "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/${INPUT_FILE_BASE}.html"
@adamgit
adamgit / .gitignore
Last active September 13, 2025 22:55
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@dru8274
dru8274 / FuBar
Last active March 10, 2024 23:08
Statusbar for FVWM
## vim: syntax=fvwm:
##
## FBBar - a combined system-tray and status-bar.
##
## The statusbar is implemented as an FvwmButtons module. An fvwmperl
## module FuBarStats uses Sys::Statistics::Linux to monitor system info,
## and to keep FuBar updated with the info.
DestroyModuleConfig FuBar: *
*FuBar: Geometry 1366x20
@shmup
shmup / torrents.md
Last active January 13, 2026 18:04
transmission blocklist guide

Transmission Blocklist

The Transmission torrent client has an option to set a Blocklist, which helps protect you from getting caught and having the DMCA send a letter/email.

It's as simple as downloading and installing the latest client: