Skip to content

Instantly share code, notes, and snippets.

definitions:
type:
type: string
required:
type: array
items:
type: string
properties:
type: object
properties:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt-get install -y gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 900 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 900
sudo apt-get install -y git cmake libgles2-mesa-dev libbz2-dev liblzma-dev
# ./configure --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk --prefix=/Users/jtang/Documents/Projects/cocoa_code/mobile-ffmpeg/prebuilt/ios-arm64-ios-darwin/ffmpeg --enable-version3 --arch=aarch64 --cpu=armv8 --target-os=darwin --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='/Users/jtang/Documents/Projects/cocoa_code/mobile-ffmpeg/.tmp/gas-preprocessor.pl -arch aarch64 -- clang -arch arm64 -target aarch64-ios-darwin -march=armv8-a+crc+crypto -mcpu=generic -DMOBILE_FFMPEG_ARM64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -fembed-bitcode -DIOS -DMOBILE_FFMPEG_BUILD_DATE=20190409 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk -Oz -miphoneos-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/usr/include' --ranlib=
@foobra
foobra / simple git pull-request tools
Last active November 2, 2017 08:04
simple git pull-request tools
#!/bin/sh
function gl () {
now_pwd=`pwd`
while [[ ! -d ".git" ]]
do
cd ..
if [[ `pwd` = '/' ]]
then
echo 'Here is Root, Damn! Let us go back, biu~~'
cd ${now_pwd}
extension HomePageTimelineVC: UITableViewDataSource, UITableViewDelegate {
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
switch viewModel.vms[indexPath.row] {
case let model as TimelineCellPhotoViewModel:
let cell = tableView.dequeueReusableCell(withIdentifier: TimelineCellPhoto.className) as? TimelineCellPhoto
?? TimelineCellPhoto(.timeline, style: .default, reuseIdentifier: TimelineCellPhoto.className)
cell.configCell(viewModel: model, vc: self)
return cell
case let model as TimelineCellVideoViewModel:
@foobra
foobra / word-count FSM in simple way.cpp
Last active May 22, 2017 05:50
word-count FSM in simple way
#include <stdio.h>
#include <map>
#include <utility>
enum STATE
{
IN,
OUT,
};
@foobra
foobra / word-count without FSM.cpp
Created May 22, 2017 05:12
word-count without FSM
#include <stdio.h>
#include <map>
#include <utility>
#include <functional>
enum STATE
{
IN,
OUT,
};
@foobra
foobra / word-count FSM OOP Implement.cpp
Last active May 22, 2017 01:46
word-count FSM OOP Implement
#include <stdio.h>
#include <map>
#include <utility>
#include <functional>
enum STATE {
IN,
OUT,
COUNT,
};
@foobra
foobra / word-count FSM Implement.cpp
Last active May 22, 2017 01:43
First word-count FSM Implement
#include <stdio.h>
#include <map>
#include <utility>
#include <functional>
enum STATE {
IN,
OUT,
};