Skip to content

Instantly share code, notes, and snippets.

😉
happy learning

Lucia Lupeipei

😉
happy learning
Block or report user

Report or block Lupeipei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Lupeipei
Lupeipei / TodoItem.vue
Last active Apr 25, 2019
nested slot examples.
View TodoItem.vue
<template>
<li>
<span class="text-muted mr-1">{{ item.id }}.</span> {{ item.title }}
<slot name="after" :item="item" />
</li>
</template>
<script>
export default {
props: [ 'item' ]
@Lupeipei
Lupeipei / Date.vue
Last active May 11, 2018
new plugin with clear and today for flatpickr
View Date.vue
<template>
<div>
<flat-pickr v-model="date" :config="configs.selectToday"></flat-pickr>
</div>
</template>
<script>
import flatPickr from 'vue-flatpickr-component'
import SelectTodayPlugin from '../todayselect'
import ConfirmDatePlugin from 'flatpickr/dist/plugins/confirmDate/confirmDate'
@Lupeipei
Lupeipei / new.html.erb
Last active Apr 14, 2018
rails对接微信后完成手机验证
View new.html.erb
<script src="http:res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<%= wechat_config_js debug: false, api: %w(closeWindow) -%>
<style>
.disappear {
display: none;
}
</style>
<% unless @user.errors.empty? %>
<div id="error_dialog">
View application.rb
### 修改config/application.rb
require 'rails/all'
# add these line for log4r
require 'log4r'
require 'log4r/yamlconfigurator'
require 'log4r/outputter/datefileoutputter'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Zurich
class Application < Rails::Application
View gist:0afd68952413b38d4cb0ce927f9f9d66
require 'benchmark'
def binary_search(arr, element)
b = arr.sort
if b.include?(element)
return b.bsearch_index {|x| x >= element}
end
end
arr1 = Array.new(10){rand(100)}
You can’t perform that action at this time.