(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
module Paperclip | |
class Watermark < Processor | |
## | |
# A Paperclip::Processor for watermarking images with imagemagick's | |
# composite command. | |
# | |
# Place this code in lib/paperclip_processors/watermark.rb or into a Rails initializer. | |
# | |
# Example: All orginal files are resized to be at most 480 pixels in |
module Paperclip | |
class Watermark < Processor | |
## | |
# A Paperclip::Processor for watermarking images with imagemagick's | |
# composite command. | |
# | |
# Place this code in lib/paperclip_processors/watermark.rb or into a Rails initializer. | |
# | |
# Example: All orginal files are resized to be at most 480 pixels in |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
var BatchStream = require('batch-stream2') | |
var gulp = require('gulp') | |
var coffee = require('gulp-coffee') | |
var uglify = require('gulp-uglify') | |
var cssmin = require('gulp-minify-css') | |
var bower = require('gulp-bower-files') | |
var stylus = require('gulp-stylus') | |
var livereload = require('gulp-livereload') | |
var include = require('gulp-include') | |
var concat = require('gulp-concat') |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# | |
# Network services, Internet style | |
# | |
# Note that it is presently the policy of IANA to assign a single well-known | |
# port number for both TCP and UDP; hence, most entries here have two entries | |
# even if the protocol doesn't support UDP operations. | |
# | |
# The latest IANA port assignments can be gotten from | |
# | |
# http://www.iana.org/assignments/port-numbers |
# | |
# Network services, Internet style | |
# | |
# Note that it is presently the policy of IANA to assign a single well-known | |
# port number for both TCP and UDP; hence, most entries here have two entries | |
# even if the protocol doesn't support UDP operations. | |
# | |
# The latest IANA port assignments can be gotten from | |
# | |
# http://www.iana.org/assignments/port-numbers |
# В целом создание корзины магазина неплохо описано в Agile web development | |
# with Rails. Думаю что концепция CRUID для данного типа приложений выглядит | |
# более естественно. Так же хорошо вписывается в данную модель создание промежуточной | |
# сущности между item между корзиой и списком товаров. | |
# В цело данный метод слишком веоик, не интуитивен и смешивает в кучу все слои MVC. | |
class BasketController | |
def add_to_basket | |
# Предпочтительно оперировать понятием уникального идентификатора id | |
item = Item.find_by_title(params[:item_title]) |
#!/bin/bash | |
#============================================================================== | |
#TITLE: mysql_backup.sh | |
#DESCRIPTION: script for automating the daily mysql backups on development computer | |
#AUTHOR: tleish | |
#DATE: 2013-12-20 | |
#VERSION: 0.4 | |
#USAGE: ./mysql_backup.sh | |
#CRON: | |
# example cron for daily db backup @ 9:15 am |
#![allow(unused)] | |
use std::collections::HashMap; | |
fn main() { | |
let mut vec = vec![3, 5, 6, 3, 4, 7, 4]; | |
println!("Averege ={}", averege(&vec)); | |
assert_eq!(median(&mut vec), 4.0); | |
println!("Median ={}", median(&mut vec)); | |
println!("Mode ={}", mode(&vec)); | |
} | |
fn averege(v: &[i32]) -> f32 { |