Skip to content

Instantly share code, notes, and snippets.

View begin29's full-sized avatar
πŸ‘¨β€πŸ’»

Vadym Motsukh begin29

πŸ‘¨β€πŸ’»
View GitHub Profile
@begin29
begin29 / apply.js
Created March 16, 2016 15:29
JavaScript apply()
window.name = 'окошко';
var test = function () { alert(this.name); }
var obj = {
name: 'ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΈΠΊ',
fx: function() {
test();//->окошко, Ρ‚.ΠΊ. функция объявлСна Π² контСкстС window
test.apply(this);//->ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΈΠΊ, Ρ‚.ΠΊ. ΠΌΡ‹ Π²Ρ‹Π·Π²Π°Π»ΠΈ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΡŽ Π² Π½ΡƒΠΆΠ½ΠΎΠΌ Π½Π°ΠΌ контСкстС
}
}
@begin29
begin29 / linux.sh
Last active August 25, 2017 05:53
Linux commands and articles
#create link
ln -s /path/to/file /path/to/symlink
#see all available memory
df -h
#returns the number of lines, words, and bytes in a file. Can use -l, -w, -c to get just one of these.
wc
# change user password
@begin29
begin29 / linux_fs.sh
Last active May 3, 2016 11:39
Linux file system
#apache logs
/var/log/apache2/access.log - records of every page served and every file loaded by the web server.
/var/log/apache2/error.log - records of all error conditions reported by the HTTP server
@begin29
begin29 / rails_commands.rb
Last active May 3, 2017 09:47
Rails commands
# copy migrations from engine
rake railties:install:migrations
# record not new/new
persisted? # new_record?
# execute query in console
ActiveRecord::Base.connection.execute("foo")
# string to class
@begin29
begin29 / database commands.sh
Last active July 10, 2016 08:50
Database tools
# clean restore postgress database from dump
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d pixaloca_development pixaloca.dump
# create ssh-tunel to remote database
https://support.cloud.engineyard.com/hc/en-us/articles/205408088-Access-Your-Database-Remotely-Through-an-SSH-Tunnel
# sql select and group tips
https://habrahabr.ru/post/149571/
# row expiration in raw sql
@begin29
begin29 / git.rb
Last active March 14, 2017 13:48
Usefull git commads
# show changed files for specific commit
git show --pretty="format:" --name-only SHA
#debugging with git
https://git-scm.com/book/ru/v1/%D0%98%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B-Git-%D0%9E%D1%82%D0%BB%D0%B0%D0%B4%D0%BA%D0%B0-%D1%81-%D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D1%8C%D1%8E-Git
# cheatsheet for git
https://medium.com/@ABatickaya/%D1%88%D0%BF%D0%B0%D1%80%D0%B3%D0%B0%D0%BB%D0%BA%D0%B0-%D0%BF%D0%BE-git-55eeea487676#.gmoc1vf40
git log --after="2013-11-12 00:00" --before="2013-11-12 23:59"
@begin29
begin29 / bundle_dsight.sh
Created June 16, 2016 07:30
tasks for check and update bundle in server for Dsight
task :bundle_version => :environment do
queue "bundle -v"
end
task :update_bundler => :environment do
queue "gem install bundler"
end
@begin29
begin29 / gems.rb
Last active July 10, 2016 08:51
usefull gems
# soft file deleting
https://github.com/rubysherpas/paranoia
# cucumber catalog for scenarious
https://github.com/enkessler/cuke_cataloger
# cucumner query language
https://github.com/enkessler/cql
# track visits in ruby Javascript
@begin29
begin29 / health.rb
Created July 10, 2016 05:58
health issues
# relax your eyes
https://geektimes.ru/post/142096/
#
@begin29
begin29 / javascript-articles.rb
Last active July 17, 2016 08:30
Javascript tips and tricks articles
#===js books
# front-end handbook
https://www.dropbox.com/sh/t9hloz1jqtlul8p/AACbgQTOF8k-UoCY1nonQapaa?dl=0
# usefull free books about raw js
https://medium.mybridge.co/the-most-useful-free-ebooks-for-web-developers-3854767ee52f#.8dfirbgmi
# js debugging
https://developer.chrome.com/devtools/docs/javascript-debugging
# SPECIFICATION FOR BUILDING APIS IN JSON