Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
fact(0) -> 1;
fact(N) -> N * fact(N-1).
fib(0) -> 1;
fib(1) -> 1;
fib(N) -> fib(N) + fib(N-1).
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
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.
...
%%% Каждый раздел (\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
@welldan97
welldan97 / system-wide-clipboard.zsh
Created March 10, 2013 09:51
Zsh copy & paste system wide for OS X, like in emacs
pb-kill-line () {
zle kill-line
echo -n $CUTBUFFER | pbcopy
}
pb-kill-whole-line () {
zle kill-whole-line
echo -n $CUTBUFFER | pbcopy
}
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 / simple_panorama.coffee
Last active December 17, 2015 22:39
Simple panorama with three.js.
$ ->
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)
<div data-panorama="images/panorama.jpg"></div>