- Read lots of code.
- Write lots of code.
- Don’t be afraid to throw it away.
- Don’t be afraid to share it.
- Find your happy place writing tests.
- You’ll probably spend more time writing tests and debugging than writing code. Embrace this. Make it a key part of your workflow.
- Tests are one of the first things I read in a module. That and the example(s). Probably before API docs.
- Don’t know where to start. Write some tests for a module you like. This benefits everyone.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var jade = require('gulp-jade'), | |
uglify = require('gulp-uglify'), | |
concat = require('gulp-concat'), | |
plumber = require('gulp-plumber'), | |
sass = require('gulp-sass'), | |
imagemin = require('gulp-imagemin'); | |
var paths = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Your solution | |
* @date JS Date object | |
**/ | |
function solution(date){ | |
date = new Date(Date.parse(date)); | |
return summate(date.getDate().toString() + (date.getMonth()+1).toString() + date.getFullYear().toString()); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.each(simplemaps_worldmap_mapdata.regions, function(k,o) { | |
s = "region = Region.create(name: '" + o.name + "')\n"; | |
$.each(o.states, function(i,v) { | |
s += "Country.find_by(code: '" + v + "').update(country_id: region)\n"; | |
}); | |
console.log(s + "\n\n"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PluginCloseprofile_ActionProfile extends PluginCloseprofile_Inherit_ActionProfile { | |
/** | |
* Проверка корректности профиля | |
*/ | |
protected function CheckUserProfile() { | |
if(parent::CheckUserProfile() === false) return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function d() { | |
jQuery('.post_table:visible .post_delete_button').each( function(i,v) { | |
v.click(); | |
}); | |
scroll(0, document.body.scrollHeight); | |
}; | |
setInterval(d, 5000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
class User < ActiveRecord::Base | |
attr_accessor :read # user's agreement | |
scope :unbanned, where(:banned => false) | |
scope :last_users, ->(count) { order("id DESC").limit(count) } | |
include Models::User::City | |
include Models::User::MessageStuff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
#default_scope where(:banned => false) | |
scope :unbanned, where(:banned => false) | |
include ChooseCity | |
rolify | |
acts_as_voter | |
has_karma(:questions, :as => :submitter, :weight => 0.5) | |
mount_uploader :avatar, AvatarUploader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Thanks to: | |
http://stackoverflow.com/a/9649638/1024097 | |
### | |
class Instruction | |
constructor: -> | |
@initEvents() | |
initEvents: -> |
- 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
- Compass - Open source CSS Authoring Framework.
- Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
- Font Awesome - The iconic font designed for Bootstrap.
- Zurb Foundation - Framework for writing responsive web sites.
- SASS - CSS extension language which allows variables, mixins and rules nesting.
- Skeleton - Boilerplate for responsive, mobile-friendly development.