Skip to content

Instantly share code, notes, and snippets.

View AleksandrMihhailov's full-sized avatar
:octocat:
The only way to do great work is to love what you do

Aleksandr Mihhailov AleksandrMihhailov

:octocat:
The only way to do great work is to love what you do
View GitHub Profile
@AleksandrMihhailov
AleksandrMihhailov / Copy MySQL table to another table
Last active December 22, 2015 05:39
Copy table data to another table!
# Copy table data to another table.
CREATE TABLE new_table LIKE old_table;
INSERT new_table SELECT * FROM old_table;
@AleksandrMihhailov
AleksandrMihhailov / gist:7854992
Created December 8, 2013 09:12
Generate random password by JavaScript.
// Generate random password
Math.random().toString(36).substr(2); // return some of "ms6ons4p132qpvi"
var gulp = require('gulp'),
gutil = require('gulp-util'),
coffee = require('gulp-coffee'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
autoPrefixer = require('gulp-autoprefixer'),
minifyCss = require('gulp-minify-css');
@AleksandrMihhailov
AleksandrMihhailov / .tmux.conf
Last active January 23, 2016 14:26 — forked from zjrosen1/.tmux.conf
Tmux Configuration
# | |_ _ __ ___ _ ___ __ #
# | __| '_ ` _ \| | | \ \/ / #
# | |_| | | | | | |_| |> < #
# \__|_| |_| |_|\__,_/_/\_\ #
# 1 0 | VIM | 2:bash 20:04
# [ Reset Prefix ] {{{1
set -g prefix C-a
bind-key a send-prefix # for nested tmux sessions
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
#
require "securerandom"
puts 'Enter prefix: '
prefix = gets.chomp
p "mb_#{prefix}_" + SecureRandom.urlsafe_base64(nil, true) + SecureRandom.urlsafe_base64(nil, true)

Display ruby version in zsh

  • Add rvm to the plugins line of your ~/.zshrc file
  • At the bottom of your aliases, add an alias for rvm-prompt alias rvm-prompt=$HOME/.rvm/bin/rvm-prompt
  • Reload (you may not need this line, but if you do, put it below the above) source $ZSH/oh-my-zsh.sh
  • Add the following on the line below: RPROMPT="%{$fg[blue]%}\$(~/.rvm/bin/rvm-prompt s i v g) %{$fg[yellow]%}[%*]%{$fg[default]%}"
@AleksandrMihhailov
AleksandrMihhailov / sublime.sh
Created April 2, 2016 21:15
Making symlink to run sublime text from Mac OS console
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ~/.local/bin/sublime
@AleksandrMihhailov
AleksandrMihhailov / .nvim
Created April 4, 2016 21:48
NeoVim configuration from old VIM
mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
ln -s ~/.vim $XDG_CONFIG_HOME/nvim
ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim
@AleksandrMihhailov
AleksandrMihhailov / angular-route.js
Created April 4, 2016 22:35
Will remove /#/ hash from url
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});