Skip to content

Instantly share code, notes, and snippets.

@coins.each do |c|
#c.cur_name
cur = []
@coin_cur = Coin.where(:cur_name => c.cur_name).last
@coin_10 = Coin.where(:cur_name => c.cur_name).where("date <?", 10.minutes.ago)[-3]
@coin_20 = Coin.where(:cur_name => c.cur_name).where("date <?", 20.minutes.ago)[-5]
if @coin_cur.price.present?
#binding.pry
dif10 = ((@coin_cur.price/@coin_10.price)*100)-100
ngular.module("uploaderComponent", []).directive("fileupload", function() {
return {
restrict: "A",
scope: {
done: "&",
progress: "&",
fail: "&",
uploadurl: "="
},
link: function(scope, elem, attrs) {
@StasKoval
StasKoval / gist:6001169
Created July 15, 2013 16:05
update product desc
Product.all do |product|
product.update_attributes(:desc => product.description.gsub(/<[^>]*>/ui,''))
end
%div.large-12.columns(ng-controller="IndexController")
.section-container.auto{"data-section" => ""}
%section
%p.title{"data-section-title" => ""}
%a{:href => "#panel1"} Показать списком
.content{"data-section-content" => ""}
.row
.large-12.columns
%h5.subheader
= @category.title if @category.present?
<div ng-controller="ExampleController">
<div class="google-map"
center="position.coords"
zoom="zoomProperty"
markers="markersProperty"
draggable="true"
fit="false"
events="eventsProperty"
options='{"streetViewControl": false, "mapTypeControl":false, "zoomControl":false}'
if $state.current.name == 'tasks'
Task.query(
{}
# Success
, (response) ->
$scope.tasks = response
# Error
/*Back to top button */
#back-top{
position:fixed;
bottom:30px;
right:30px;
}
#back-top a{
width:80px;
display:block;
text-align:center;
$(document).ready(function(){
// прячем кнопку #back-top
$("#back-top").hide();
// появление/затухание кнопки #back-top
$(function (){
$(window).scroll(function (){
if ($(this).scrollTop() > 100){
$('#back-top').fadeIn();
} else{
include OmniAuth::Strategy
option :fields, [:name, :email]
option :on_login, nil
option :on_registration, nil
option :on_failed_registration, nil
option :locate_conditions, lambda{|req| {model.auth_key => req['auth_key']} }
def request_phase
if options[:on_login]
include OmniAuth::Strategy
option :fields, [:name, :email]
option :on_login, nil
option :on_registration, nil
option :on_failed_registration, nil
option :locate_conditions, lambda{|req| {model.auth_key => req['auth_key']} }
def request_phase
if options[:on_login]