Skip to content

Instantly share code, notes, and snippets.

View wegorich's full-sized avatar
💩
Crappy codding

Egor Malkevich wegorich

💩
Crappy codding
View GitHub Profile
@wegorich
wegorich / 0_reuse_code.js
Created September 29, 2013 11:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@wegorich
wegorich / digitalocean.md
Last active January 3, 2016 04:09 — forked from JamesDullaghan/digitalocean.md
Deploy rails + unicorn + capistrano + nginx

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh [email protected]

Add ssh fingerprint and enter password provided in email

# db/migrate/20111218135715_globalize_models.rb
class GlobalizeModels < ActiveRecord::Migration
def up
NewsItem.create_translation_table!(
{:title => :string, :body => :text},
{:migrate_data => true}
)
end
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@wegorich
wegorich / snippet.js
Last active August 29, 2015 14:22 — forked from necolas/snippet.js
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@wegorich
wegorich / OSX UTC Time Zone
Created March 11, 2016 14:47 — forked from nick-desteffen/OSX UTC Time Zone
Set Time zone in OSX to UTC
sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime
@wegorich
wegorich / gist:3c967a18c02dfa68927e676ce830e4e3
Created June 22, 2016 08:32 — forked from paveleremin/gist:86dafdb4341244fc3a94
Brackets are correctly nested (two different approaches)
/**
* Implement function check (text) which checks whether brackets within text are correctly nested.
* You need to consider brackets of three kinds: (), [], {}.
*/
/**
* STACK approach
*/
function check(str){
var brackets = "()[]{}",
@wegorich
wegorich / xcarchive2ipa
Created January 10, 2017 17:51 — forked from samma835/xcarchive2ipa
How to convert .xcarchive to .ipa
xcodebuild -exportArchive -exportFormat ipa -archivePath {PATH}/MyApp.xcarchive -exportPath ~/Desktop/MyApp.ipa

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by