Skip to content

Instantly share code, notes, and snippets.

View obliviusm's full-sized avatar
🏠
Can't work from home because of russians

Misha Sebalo obliviusm

🏠
Can't work from home because of russians
View GitHub Profile

Typography

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading
@obliviusm
obliviusm / commands.md
Last active October 29, 2020 08:28
Commands
Rake
  1. rake -T -A Run from your Rails home directory to see all the tasks that rake knows about. Yours must be in that list for rake to run it.
  2. http://stackoverflow.com/questions/12409544/how-to-disable-rack-mini-profiler-temporarily
  3. run rails in production mode lacaly: bundle exec rake assets:clean && bundle exec rake assets:precompile && bundle exec rails s -e production_local
  4. bundle exec rake konacha:serve
  5. rake time:zones:all - all available time zones
Git
  1. Reset all changes after last commit in git First reset the changes git reset HEAD --hard then clean out everything untracked git clean -fd
  2. Removing multiple files from a Git repo that have already been deleted from disk git ls-files --deleted -z | xargs -0 git rm
@obliviusm
obliviusm / useful.md
Last active August 29, 2015 14:24
Useful

Rocky Mountain Ruby 2012 - Go Ahead, Make a Mess by Sandi Metz

  • class_name.constantize.new()

Aloha Ruby Conf 2012 Refactoring from Good to Great by Ben Orenstein

  • @contact = contact || NullContact.new
  • refactoring:
    1. god object
  1. high churn files
@obliviusm
obliviusm / ruby_refactoring_patterns.md
Last active August 29, 2015 14:24
Object-Oriented Design and Refactoring Patterns in Ruby
@obliviusm
obliviusm / ruby_patterns.md
Last active September 7, 2020 05:00
book **Design Patterns in Ruby** by *Russ Olsen*
@obliviusm
obliviusm / countCSSRules.js
Created September 23, 2015 14:35 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@obliviusm
obliviusm / Makefile.config
Created February 14, 2016 19:53
config for caffe 7.5 on my PC
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Скрипт для скачивания музыки с сайта vkontakte.ru (vk.com)
Запуск:
python vkcom_audio_download.py
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,