Skip to content

Instantly share code, notes, and snippets.

View r3nya's full-sized avatar
☮️
¯\_(ツ)_/¯

Andrew M. r3nya

☮️
¯\_(ツ)_/¯
View GitHub Profile

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

Вступление

Во-первых, это моё мнение, и я его никому не навязываю. Во-вторых, список не обязательно исчерпывающий. В-третьих, он ориентирован на определённую "философию", которая тоже не является исчерпывающей или абсолютно правильной. Поэтому, если Вам эти рекомендации не подходят -- не следуйте им.

Философия такова. Для того чтобы осмысленно программировать на начальном этапе не нужно знать Computer Science, теорию алгоритмов и сложности вычислений или детально разбираться в устройстве и работе компьютера. Достаточно хорошо делать две вещи:

  1. алгоритмизировать решение задачи (разбивать его на простые последовательные шаги: сначала это, а потом вот это),
  2. знать, понимать смысл и назначение, использовать и подгонять друг к другу стандартные элементы решений (условия, циклы, структуры данных, алгоритмы и прочие "паттерны")
files = Dir["./**/*"]
files.each do |file|
next if File.directory?(file)
words = []
begin
File.read(file).scan /[\u0400-\u04FF\-]+/ do |match|
words << match
end
@r3nya
r3nya / gulpfile.js
Created December 22, 2015 10:31 — forked from c01nd01r/gulpfile.js
Gulp build error to browser
//npm i gulp gulp-stylus gulp-plumber browser-sync bs-fullscreen-message
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var plumber = require('gulp-plumber');
var browserSync = require('browser-sync').create();
//Enable "Fullscreen Messages" plugin in Browsersync Plugins web settings (http://localhost:3001/plugins)
//Notification template
var bsError = function(data) {
- name: create user $user
action: user name=$user
- name: download rbenv-installer for $user
action: get_url url=https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer dest=/tmp/rbenv-installer mode=0755
- name: run rbenv-installer
action: raw HOME=/home/$user /tmp/rbenv-installer
- name: copy rbenv environment setup
---
- name: install rb-installer
action: shell curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
- name: update PATH in ~/.bash_profile for rb-env
action: lineinfile dest=/home/$user/.bash_profile line=export\ PATH="$HOME/.rbenv/bin:$PATH" regexp=PATH.*rbenv
- name: add rb-env init to ~/.bash_profile
action: lineinfile dest=/home/$user/.bash_profile line='eval "$(rbenv init -)"' regexp=eval.*rbenv
@r3nya
r3nya / bluepill
Created October 12, 2013 17:33 — forked from sasha-id/bluepill
#!/bin/sh
### BEGIN INIT INFO
# Provides: bluepill
# Required-Start: $local_fs $remote_fs $network $syslog $time
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: bluepill daemon, providing process monitoring
# Description: bluepill is a monitoring tool. More info at http://github.com/arya/bluepill.
---
# Attempt to check if the folder exist.
# If it exist echo out a string. You have to echo something
# if the directory does exist or else the task is considered failed
# Output is set to $is_default_created. Note that this variable is
# object and not an atomic value.
- name: Attempt to check if a directory exist
action: shell test -d /my/folder && echo "exist" || echo ""
register: is_folder_created
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@r3nya
r3nya / README.md
Created September 27, 2016 18:34 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version