Skip to content

Instantly share code, notes, and snippets.

View vyorkin's full-sized avatar
❤️‍🔥

Vasiliy Yorkin vyorkin

❤️‍🔥
View GitHub Profile
@vyorkin
vyorkin / my sublime text 2 packages
Created July 23, 2013 19:48
my sublime text 2 package list
* [AdvancedNewFile](https://github.com/skuroda/Sublime-AdvancedNewFile)
* [AngularJS](https://github.com/angular-ui/AngularJS-sublime-package)
* [AngularJS (CoffeeScript)](https://github.com/Iristyle/Sublime-AngularJS-Coffee-Completions)
* [AngularJS Snippets](https://github.com/maxhoffmann/angular-snippets)
* [ApplySyntax](https://github.com/facelessuser/ApplySyntax)
* [Automatic Backups](https://github.com/joelpt/sublimetext-automatic-backups)
* [BracketHighlighter](https://github.com/facelessuser/BracketHighlighter)
* [ChangeQuotes](https://github.com/colinta/SublimeChangeQuotes)
* [Clipboard History](https://github.com/kemayo/sublime-text-2-clipboard-history)
* [Coffee Formatter](https://github.com/derekchiang/Sublime-CoffeeScript-Formatter)
@vyorkin
vyorkin / gist:6359406
Created August 27, 2013 21:28
docxtor2 usage example
# Usage sample:
# elements - any collection of your elements, so in this example i have:
# class Element
# attr_reader :title1, :title2, :content
# end
# elements = Array.new(5, Element)
# Somewhere in your controller:
def report
include Java
# Here's where is my "somelib.jar" located
Dir["lib/java/\*.jar"].each { |jar| require jar }
include MyClass
# ....
app_name = "myApp"
app = angular.module "#{app_name}.controllers", []
class BaseController
@register: (app, name) ->
name ?= @name || @toString().match(/function\s*(.*?)\(/)?[1]
app.controller name, @
@inject: (args...) ->
@$inject = args
class @Base
constructor: (args...) ->
for key, index in @constructor.$inject
@[key] = args[index]
@inject: (args...) -> @$inject = _.union @$inject args
class @BaseCtrl extends @Base
constructor: (args...) ->
module APICommonHelpers
def access_denied!(message = 'Access denied')
error! message, 401
end
def bad_request!(message = 'Bad request')
error! message, 400
end
def forbidden_request!(message = 'Forbidden')
require 'active_support/core_ext/hash'
require 'capistrano/undev'
require 'capistrano-db-tasks'
require 'airbrake/capistrano3'
require './config/boot'
SSHKit.config.command_map[:rake] = 'bundle exec rake'
@vyorkin
vyorkin / gist:e2b9b1205634b9656ee0
Created October 19, 2014 21:54
basic makefile skeleton
CXX=clang++
FLAGS=-std=c++11 -stdlib=libc++
all:
clean:
rm -fr build/*
test:
$(CXX) $(FLAGS) src/test.cpp -o build/test.bin -Isrc/
@vyorkin
vyorkin / Guardfile
Created December 28, 2014 18:04
turbo Guardfile
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec feature)
## Uncomment to clear the screen before every task
# clearing :on
## Guard internally checks for changes in the Guardfile and exits.
@vyorkin
vyorkin / MskTimeZone
Last active August 29, 2015 14:12
some dikiy pizdets
class I18nTimeZone < ActiveSupport::TimeZone
class << self
def all
TZInfo::Timezone.all.map do |tzinfo|
utc_offset = tzinfo.current_period.utc_offset
create(tzinfo.name, utc_offset, tzinfo)
end
end
end