Skip to content

Instantly share code, notes, and snippets.

View onesup's full-sized avatar

이원섭wonsup Lee/Alfonso onesup

View GitHub Profile
@onesup
onesup / pc.js
Created September 25, 2014 02:10
페북 로긴 권한 참고용.
function user_signed_in(){
};
$(document).ready(function(){
$('#message_button').click(function(e) {
e.preventDefault();
$.ajax({
type: 'get',
url: '/event_finish.json',
success: function (data) {
// First nominate the div to hold the Raphael svg
var r = Raphael("holder", 695, 600);
var circX = 350;//$('#outerWrapper').width() / 2,
var circY = 260;//$('#outerWrapper').height() / 2,
var circle1 = r.circle(circX, circY, 0).attr({fill:"#00FF00", 'stroke-width':0, 'opacity':'.2'});
var circle2 = r.circle(circX, circY, 0).attr({fill:"#0000ff", 'stroke-width':0, 'opacity':'.2'});
var circle3 = r.circle(circX, circY, 0).attr({fill:"#ff0000", 'stroke-width':0, 'opacity':'.2'});
var disappear = Raphael.animation({opacity: 0}, 200, function(){
circle1.remove();
// First nominate the div to hold the Raphael svg
var r = Raphael("holder", 695, 600);
var circX = 350;//$('#outerWrapper').width() / 2,
var circY = 260;//$('#outerWrapper').height() / 2,
var circle1 = r.circle(circX, circY, 0).attr({fill:"#00FF00", 'stroke-width':0, 'opacity':'.2'});
var circle2 = r.circle(circX, circY, 0).attr({fill:"#0000ff", 'stroke-width':0, 'opacity':'.2'});
var circle3 = r.circle(circX, circY, 0).attr({fill:"#ff0000", 'stroke-width':0, 'opacity':'.2'});
var disappear = Raphael.animation({opacity: 0}, 200, function(){
circle1.remove();
minivertising06:
Data failed to compile:
----------
No matching sls found for 'sync_cooolcool' in env 'base'
minivertising07:
Data failed to compile:
----------
No matching sls found for 'sync_cooolcool' in env 'base'
@onesup
onesup / coupon_confirm.js
Created May 7, 2014 02:32
서버에서 쿠폰 사용 가능 여부 판단
$("#coupon_confirm").click(function(e){
e.preventDefault();
var url = "/" + $("#coupon_confirm").attr("data-code");
$.ajax({
type: 'get',
url: '/coupon_finish.json',
success: function (data) {
if(data.result == "finish"){
alert("아쉽네요!\n다음엔 조금더 서둘러주세요~");
}else{
@onesup
onesup / gist:9887219
Created March 31, 2014 07:47
<%= session[:referer] %> 부분에 레퍼러 들어가면 됨.
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<%= Rails.application.secrets.ga_tracking_id%>', '<%= Rails.application.secrets.url %>');
ga('set', 'referrer', '<%= session[:referer] %>');
ga('send', 'pageview');
</script>
@onesup
onesup / error.log
Created March 6, 2014 04:28
refarm.org django error log
[Thu Mar 06 13:25:56 2014] [error] get_interpreter: no interpreter callback found.
[Thu Mar 06 13:25:56 2014] [error] [client 131.253.24.4] python_handler: Can't get/create interpreter.
[Thu Mar 06 13:26:00 2014] [error] make_obcallback: could not import mod_python.apache.\n
Traceback (most recent call last):
File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 29, in ?
import cgi
File "/usr/lib64/python2.4/cgi.py", line 40, in ?
import mimetools
File "/usr/lib64/python2.4/mimetools.py", line 6, in ?
import tempfile
@onesup
onesup / home_controller.rb
Created February 18, 2014 07:37
gabba 적용
class HomeController < ApplicationController
def switch
tracking_id = Rails.application.secrets.ga_tracking_id
url = Rails.application.secrets.url
Gabba::Gabba.new(tracking_id, url).page_view("pc/mobile switch page", "/")
user_agent = UserAgent.parse(request.user_agent)
if user_agent.mobile?
redirect_to mobile_index_path({s: params[:s]})
else
redirect_to home_index_path({s: params[:s]})
deployer ALL = (ALL:ALL) ALL
deployer ALL=NOPASSWD:/bin/cp /tmp/unicorn_init /etc/init.d/unicorn_rails_example
deployer ALL=NOPASSWD:/etc/init.d/unicorn_rails_example start
deployer ALL=NOPASSWD:/etc/init.d/nginx reload
deployer ALL=NOPASSWD:/bin/ln
deployer ALL=NOPASSWD:/bin/cp
@onesup
onesup / deploy.rb
Created January 20, 2014 16:25
deploy
require "bundler/capistrano"
require "net/sftp"
set :rails_env, "production" #added for delayed job
set :application, "kfarm"
set :user, "onesup"
set :deploy_to, "/home/#{user}/#{application}"
set :deploy_via, :copy
set :use_sudo, false
set :scm, "git"