Skip to content

Instantly share code, notes, and snippets.

if $state.current.name == 'tasks'
Task.query(
{}
# Success
, (response) ->
$scope.tasks = response
# Error
<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}'
%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?
@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
ngular.module("uploaderComponent", []).directive("fileupload", function() {
return {
restrict: "A",
scope: {
done: "&",
progress: "&",
fail: "&",
uploadurl: "="
},
link: function(scope, elem, attrs) {
@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
@StasKoval
StasKoval / gist:f039a916808b4c568a6f
Created June 2, 2014 22:43
example simple http auth
class ApplicationController < ActionController::Base
before_filter :authenticate
protect_from_forgery with: :exception
protected
def authenticate
authenticate_or_request_with_http_basic do |username, password|
username == "user" && password == "password"
2014-Jun-04 14:11:28.838139 Read command: transfer 0 21LHPF82QBaEFDWDs8NrgpYq37w5QJcQQQUX1wqDAuAD2QW7oymMj1m3DiC8V6wg7HXYRQyUbihvB4jHzy1S9jzsBjVMK2Q 939913 2106ad3ea279bf34d687b29d530a3229d88edadac48aa5b5f0cf4145555e24a0
2014-Jun-04 14:12:18.381944 Read command: transfer 0 21LHPF82QBaEFDWDs8NrgpYq37w5QJcQQQUX1wqDAuAD2QW7oymMj1m3DiC8V6wg7HXYRQyUbihvB4jHzy1S9jzsBjVMK2Q 100000 2106ad3ea279bf34d687b29d530a3229d88edadac48aa5b5f0cf4145555e24a0
2014-Jun-04 14:12:53.177725 Read command: transfer 0 21LHPF82QBaEFDWDs8NrgpYq37w5QJcQQQUX1wqDAuAD2QW7oymMj1m3DiC8V6wg7HXYRQyUbihvB4jHzy1S9jzsBjVMK2Q 70000 2106ad3ea279bf34d687b29d530a3229d88edadac48aa5b5f0cf4145555e24a0
2014-Jun-04 14:13:04.406816 Read command: transfer 0 21LHPF82QBaEFDWDs8NrgpYq37w5QJcQQQUX1wqDAuAD2QW7oymMj1m3DiC8V6wg7HXYRQyUbihvB4jHzy1S9jzsBjVMK2Q 70000 2106ad3ea279bf34d687b29d530a3229d88edadac48aa5b5f0cf4145555e24a0
2014-Jun-04 14:13:06.038349 Read command: transfer 0 21LHPF82QBaEFDWDs8NrgpYq37w5QJcQQQUX1wqDAuAD2QW7oymMj1m3DiC8V6wg7HXYRQyUbihvB4jHzy1S9jz
#!/usr/bin/env bash
END=18
for ((i=1;i<=END;i++)); do
{ ./simpleminer --pool-addr=79.135.200.61:7777 --login=1FUtZJ9Ao8qg1MiNa6RfRJKY4aFH885wD13Lf6U7xL4FS58f7i6CYL58s8dg2aV8maRzzaQG1c1kCTMDw8LKAEG5LQsW7M8 --pass x; } & done;
WAITPIDS="$WAITPIDS "$!;...; wait $WAITPIDS
root@node-61:~/pool# cat config.json
{
"coin": "boolberry",
"symbol": "BBR",
"logLevel": "debug",
"logColors": true,
"coinUnits": 1000000000000,