Skip to content

Instantly share code, notes, and snippets.

View beautyfree's full-sized avatar
😼

Alexey Elizarov beautyfree

😼
View GitHub Profile
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 = {
/**
* 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());
}
@beautyfree
beautyfree / regions.js
Last active January 4, 2016 08:09
simplemap map data for database(db) seeds
$.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");
});
<?php
class PluginCloseprofile_ActionProfile extends PluginCloseprofile_Inherit_ActionProfile {
/**
* Проверка корректности профиля
*/
protected function CheckUserProfile() {
if(parent::CheckUserProfile() === false) return false;
@beautyfree
beautyfree / level-up.md
Last active January 2, 2016 09:59
level-up.md

Core Principals

  • 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.
@beautyfree
beautyfree / vk.js
Created January 4, 2014 14:41
Чистим стену вконтакте. Удалить стену вк. jquery/firefox + greasemonkey
function d() {
jQuery('.post_table:visible .post_delete_button').each( function(i,v) {
v.click();
});
scroll(0, document.body.scrollHeight);
};
setInterval(d, 5000);
@beautyfree
beautyfree / user.rb
Created January 2, 2014 11:35 — forked from Olefine/user.rb
# 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
@beautyfree
beautyfree / user.rb
Created January 2, 2014 11:34 — forked from kirs/user.rb
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
###
Thanks to:
http://stackoverflow.com/a/9649638/1024097
###
class Instruction
constructor: ->
@initEvents()
initEvents: ->
@beautyfree
beautyfree / css_resources.md
Created December 18, 2013 14:54 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 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.

Guides