This file contains hidden or 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
| # FOR BUSY JOBS | |
| # take the process_id from the /busy page in sidekiq and kill the longest running one. | |
| workers = Sidekiq::Workers.new | |
| long_process_id = 'integration.3:4:71111aaa111' # Eg: 'integration.3:4:71d1d7f4ef5a' | |
| workers.each do |process_id, thread_id, work| | |
| process = Sidekiq::Process.new('identity' => process_id) | |
| process.stop! if process_id == long_process_id | |
| end | |
| # FOR SCHEDULED JOBS |
This file contains hidden or 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
| <?php | |
| /** | |
| * This file is part of Namespace for Magento. | |
| * | |
| * @license All rights reserved | |
| * @author Phuong LE <phuong.le@agence-soon.fr> <@> | |
| * @category Namespace | |
| * @package Namespace_Core | |
| * @copyright Copyright (c) 2016 Agence Soon (http://www.agence-soon.fr) | |
| */ |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'open-uri' | |
| require 'JSON' | |
| require 'digest/sha2' | |
| require 'pry' | |
| require 'bigdecimal' | |
| require 'bitcoin' # Because I need to cheat every now and then | |
| # Usage: | |
| # gem install pry json ffi ruby-bitcoin |
This file contains hidden or 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
| # install and make run basic bootstrap date-picker functionality described here http://www.eyecon.ro/bootstrap-datepicker/ | |
| # app/assets/javascript/datepicker.js.coffee | |
| $(document).on 'pageChanged', -> | |
| # datepicker for simple_form & Ransack | |
| $(".custom_datepicker_selector").datepicker().on 'changeDate', (en) -> | |
| correct_format = en.date.getFullYear() + '-' + ('0' + (en.date.getMonth() + 1)).slice(-2) + '-' + ('0' + en.date.getDate()).slice(-2) # date format yyyy-mm-dd | |
| $(this).parent().find("input[type=hidden]").val(correct_format) |
This file contains hidden or 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
| class Api::RegistrationsController < Api::BaseController | |
| respond_to :json | |
| def create | |
| user = User.new(params[:user]) | |
| if user.save | |
| render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
| return | |
| else |
This file contains hidden or 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
| require 'socket' | |
| require 'openssl' | |
| require 'net/ftp' | |
| class Net::FTPS < Net::FTP | |
| end | |
| class Net::FTPS::Implicit < Net::FTP | |
| FTP_PORT = 990 |