Skip to content

Instantly share code, notes, and snippets.

View xuwupeng2000's full-sized avatar

Jack Wu xuwupeng2000

View GitHub Profile
RSpec::Matchers.define :subset_of do |expected|
match do |actual|
Set.new(actual).subset?(Set.new(expected))
end
end
let(:valid_content_types) { %w(push image text image video link) }
it 'sends message content to Google Analytics via Sidekiq' do
allow(Sidekiq::Client).to receive(:new).and_return(sidekiq_client)
https://www.dropbox.com/s/mvq3tc8oumpmp6w/instantclient_12_1.zip?dl=0
#Push Notification
## Intro
We use third party notification service from Urban Airship API v3 (UA)
We send UA we want to send notification to which device and the content of message then UA will send it for us.
## Key points
Each device is identified by push token in UA.
Each device is identified by device_identifier in ThunderMaps.
Every time user login on his/her mobile device we get a new push token from UA,
let mapleader=","
set rtp+=~/.vim/terminology/vundle/
call vundle#rc()
filetype off
so ~/.vim/terminology/plugins
set t_Co=256
set background=dark
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
$ ->
tooltips = $('.js-nice-tooltip')
_.each(tooltips, (element) ->
new Ui.Views.NiceTooltip(el: element)
)
class Ui.Views.NiceTooltip extends Backbone.View
initialize: () ->
@data = this.$el.data('content')
#TODO Recommend extracting to its own class when next touching this method
def create_opening_stock_records(stock_type_ids, destroy_existing_if_not_listed=false)
if destroy_existing_if_not_listed
sc = StockClass.arel_table
fsc = FarmStockClass.arel_table
st = StockType.arel_table
fst = FarmStockType.arel_table
" Vundle
Bundle 'gmarik/vundle'
" Utilities
Bundle 'tomtom/tlib_vim'
Bundle 'MarcWeber/vim-addon-mw-utils'
Bundle 'xolox/vim-misc'
Bundle 'xolox/vim-shell'
Bundle 'mattn/webapi-vim'