Skip to content

Instantly share code, notes, and snippets.

Dmitry Yakimov welldan97

Block or report user

Report or block welldan97

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View emojify-git.sh
master_char='🗻'
improvement_char='🌀'
bug_char='🐛'
experiment_char='🎇'
documentation_char='📓'
feature_char='💡'
eval-var() {
eval echo $1
}
@welldan97
welldan97 / clean_repo.sh
Last active Jan 2, 2016
Clean up git repo
View clean_repo.sh
#!/bin/bash
main(){
reset_branch
remove_all_branches_besides_current
remove_all_stashes
remove_all_uncheked_files
}
reset_branch(){
View embed.html
<div data-panorama="images/panorama.jpg"></div>
@welldan97
welldan97 / simple_panorama.coffee
Last active Dec 17, 2015
Simple panorama with three.js.
View simple_panorama.coffee
$ ->
class Panorama360
constructor: (container) ->
$container = $(container)
source = $container.data("panorama")
@camera = new THREE.PerspectiveCamera(70, $container.width() / $container.height(), 1, 1100)
@camera.target = new THREE.Vector3(0, 0, 0)
@scene = new THREE.Scene()
sphereGeometry = new THREE.SphereGeometry(500, 60, 40)
View vehicle_email.rb
class VehicleEmail
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
attr_accessor :recipients, :subject, :message, :vehicle_id
validates_presence_of :subject, :message, :vehicle_id, :recipients
def deliver_from(admin_user)
if valid?
@welldan97
welldan97 / system-wide-clipboard.zsh
Created Mar 10, 2013
Zsh copy & paste system wide for OS X, like in emacs
View system-wide-clipboard.zsh
pb-kill-line () {
zle kill-line
echo -n $CUTBUFFER | pbcopy
}
pb-kill-whole-line () {
zle kill-whole-line
echo -n $CUTBUFFER | pbcopy
}
View 1-before.tex
...
%%% Каждый раздел (\section) с новой страницы
\let\stdsection\section
\renewcommand\section{\newpage\stdsection}
%%% В введении нумерация подразделов идёт с буквой «В» (например В.1)
\makeatletter
\renewcommand\thesubsection{\ifnum\c@section=0{В.\arabic{subsection}}\else{\arabic{section}.\arabic{subsection}}\fi}
\makeatother
View gist:2254875
1> Products = [{pen, 5, 10}, {pencil, 3, 4}].
[{pen,5,10},{pencil,3,4}]
2> [{pen, PenQuantity, PenCost},_] = Products.
[{pen,5,10},{pencil,3,4}]
3> PenQuantity.
5
4> PenCost.
View gist:2251288
fib(4) = fib(3) + fib(2)
таак, а
fib(3) = fib(2) + fib(1)
ага,
fib(2) = fib(1) + fib(0)
о, теперь всё есть
fib(0) = 1
fib(1) = 1
fib(2) = fib(1) + fib(0) = 1 + 1 = 2
fib(3) = fib(2) + fib(1) = 2 + 1 = 3
View gist:2251219
fib(0) -> 1;
fib(1) -> 1;
fib(N) -> fib(N) + fib(N-1).
You can’t perform that action at this time.