Skip to content

Instantly share code, notes, and snippets.

View bsmirnov's full-sized avatar

Boris Smirnov bsmirnov

View GitHub Profile
@acdha
acdha / rename-authors.sh
Created March 7, 2009 01:47
Renaming author history in git
#!/bin/sh
git filter-branch -d `mktemp -d -u -t git-filter` --env-filter \
'
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL;
GIT_AUTHOR_NAME=`echo $GIT_AUTHOR_NAME | sed -e "s/adamsc/Chris Adams/g"`;
GIT_AUTHOR_EMAIL=`echo $GIT_AUTHOR_EMAIL | sed -e "s/adamsc@.*/chris@improbable.org/g"`;
GIT_COMMITTER_NAME=`echo $GIT_COMMITTER_NAME | sed -e "s/adamsc/Chris Adams/g"`;
GIT_COMMITTER_EMAIL=`echo $GIT_COMMITTER_EMAIL | sed -e "s/adamsc@.*/chris@improbable.org/g"`;
' HEAD
@vixh
vixh / restore_drupal_content.sh
Created September 4, 2010 19:45
Restore Drupal content from remote server
#!/bin/bash
# Restore Drupal content from remote server
REMOTE_PATH='root@v4324.vps.masterhost.ru:/var/www/vhosts/'
REMOTE_HTML='/httpdocs/'
HOME_PATH='/home/'
HOME_HTML='/public_html/'
if [ $1 == '' ] ; then
@jgomezdans
jgomezdans / sun_position.py
Created December 8, 2010 19:12
Finding the position of the sun
def sun_position ( date, hour, longitude, latitude ):
"""
Calculates the position of the sun given a position and time.
Basically, all you need to know is here:
http://answers.google.com/answers/threadview/id/782886.html
"""
import time
from math import sin, cos, degrees, radians, acos
doy = int ( time.strftime( "%j", time.strptime( date, "%Y-%m-%d" ) ) )
@victorbstan
victorbstan / SASS_rouded_corner_mixins.sass
Created March 27, 2011 18:48
SASS cross browser rounded corner mixins
$default_rounded_amount: 5px
// Round corner at position by amount.
@mixin round-corner($position, $amount: $default_rounded_amount)
border-#{$position}-radius: $amount
-webkit-border-#{$position}-radius: $amount
@mixin round-corner-mozilla($position, $amount: $default_rounded_amount)
-moz-border-radius-#{$position}: $amount
// Round left corners by amount
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active July 10, 2024 14:36
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@chitchcock
chitchcock / 20111012_iCloudAndSharedAppleID.md
Created October 12, 2011 21:21
Using iCloud on multiple devices with shared Apple ID

But what if I share my Apple ID? If multiple people use your Apple ID (say, if you have one central account for your, your spouse’s, and your children’s purchases), you can still use this ID among you for purchases, but each person will have to create a separate iCloud account for syncing and backup.

For example, if you have an Apple ID (or MobileMe account) you use between you, your significant other, and your daughter for purchases, but they'd like to take advantage of iCloud's sync and storage features, you'll want to do the following: Have each family member sign up for an iCloud account for their backups, mail, etc; then, after setting up iCloud on their iOS devices, go to the Store preference pane within the Settings app, sign out of the iCloud account (which will populate there automatically after you sign up), then sign into the original Apple ID you use for purchases.

If the Apple ID your family uses for purchases is also your primary account for syncing (if it's a MobileMe account, for exampl

LESS 1.2.0

Now available on http://lesscss.org and NPM.

This release opens up the powerful branching capabilities of mixin guards and pattern-matching as an alternative to conditional statements.

In trying to stay as close as possible to the declarative nature of CSS, LESS has opted to implement conditional execution via guarded mixins, in the vein of @media query feature specifications:

@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.