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
My unicorn and nginx configuration | |
use ln -s and place new_app in 'sites-enabled' folder | |
usefull commands: | |
lsof -wni tcp:8080 - get PID of all unicorn processes | |
kill -9 PID - kill process | |
nginx -s reload - reload nginx | |
unicorn_rails -c /home/workspace/new_app/config/unicorn.rb -D - starts unicorn server |
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 | |
module Spree | |
module Core | |
module ProductFilters | |
if Spree::Property.table_exists? | |
Spree::Product.add_search_scope :color_filer do |*opts| |
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
Ember.Handlebars.registerBoundHelper 'testing-helper', (el0)-> | |
new Handlebars.SafeString("<b>Debug Handlebar! 0 args</b> #{el0}") | |
Ember.Handlebars.registerBoundHelper 'testing-helper-1', (el0)-> | |
new Handlebars.SafeString("<b>Debug Handlebar! 1 arg</b> #{el0}") | |
Ember.Handlebars.registerBoundHelper 'testing-helper-2', (el0, el1)-> | |
new Handlebars.SafeString("<b>Debug Handlebar! 2 args</b> #{el0} #{el1}") |
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
user www-data; | |
worker_processes 4; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { |
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
ok = false | |
while(!ok) | |
users_list_ids = User.all.pluck(:id).shuffle | |
User.all.each_with_index do |user, index| | |
user.update_attribute(:target_id, users_list_ids[index]) | |
end | |
ania_ok = User.find_by(name: 'Ania').target.name != 'Damian' |
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
import React, { | |
createContext, | |
useState, | |
useEffect, | |
useRef, | |
useCallback, | |
} from 'react'; | |
const initialToast = { | |
message: '', |
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
import React, {useContext, useEffect, useRef} from 'react'; | |
import {ToastContext} from './ToastContext'; | |
import { | |
Text, | |
Animated, | |
Easing, | |
TouchableOpacity, | |
StyleSheet, | |
} from 'react-native'; |
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
const styles = StyleSheet.create({ | |
toast: { | |
borderRadius: 4, | |
marginHorizontal: 16, | |
padding: 4, | |
position: 'absolute', | |
top: 0, | |
zIndex: 2, | |
right: 0, | |
left: 0, |
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
useEffect(() => { | |
if (toast.visible) { | |
timeout.current = setTimeout(hide, 1500); | |
return () => { | |
if (timeout.current) { | |
clearTimeout(timeout.current); | |
} | |
}; | |
} | |
}, [hide, toast]); |
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
useEffect(() => { | |
if (toast.visible) { | |
timeout.current = setTimeout(hide, 1500); | |
return () => { | |
if (timeout.current) { | |
clearTimeout(timeout.current); | |
} | |
}; | |
} | |
}, [hide, toast]); |
OlderNewer