Skip to content

Instantly share code, notes, and snippets.

View Lupeipei's full-sized avatar
😉
happy learning

Lucia Lupeipei

😉
happy learning
View GitHub Profile
#!/usr/bin/env bash
set -ex
apt install -y libwebp-dev libopenjp2-7-dev librsvg2-dev libx265-dev libde265-dev automake
mkdir ~/build
cd ~/build
git clone --branch v1.6.2 https://github.com/strukturag/libheif
@Lupeipei
Lupeipei / install_ffmpeg_libfdkaac.sh
Last active August 10, 2020 08:10 — forked from rafaelbiriba/install_ffmpeg_libfdkaac.sh
Install FFmpeg with libfdk_aac support (For Ubuntu)
# Criando um script .sh para executar todos os comandos:
#root@servidor:~# vi script.sh
#root@servidor:~# chmod +x script.sh
#root@servidor:~# ./script.sh
apt-get update
apt-get -y install autoconf automake build-essential git-core libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libmp3lame-dev nasm gcc yasm && true
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git
@Lupeipei
Lupeipei / TodoItem.vue
Last active April 25, 2019 10:01
nested slot examples.
<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 07:49
new plugin with clear and today for flatpickr
<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 April 14, 2018 09:42
rails对接微信后完成手机验证
<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">
@Lupeipei
Lupeipei / application.rb
Last active March 8, 2018 11:57
配置log4r
### 修改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
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)}