Skip to content

Instantly share code, notes, and snippets.

@zhangwebb
zhangwebb / gist:f9b81cf3c79891618cf921a813f1b389
Created March 11, 2017 11:40 — forked from yangyuqian/gist:7158b4ff25524c3de6dde978a45bd882
Go Vendoring源码阅读笔记与用法分析

为什么引入Vendoring机制?

Go1.5之后有一些比较重要的改动,其中包含Vendoring的支持,本文从使用和源码实现整理了一些备忘录,难免有疏漏,各位看官多指教。

没有引入Vendoring机制时,Go项目组织主要有两种方案:

  • 直接把项目放到GOPATH下面[详见: 附录1]
  • 项目放到GOPATH外,修改GOPATH来使用Go Command[详见: 附录2]

第三方依赖管理的灵活性和便捷性要求Go加入一种新机制,在不打破现有GOPATH假设的情况下,扩展GOPATH的package查找能力,这就是本文中介绍的Vendoring机制.

@yangyuqian
yangyuqian / gist:7158b4ff25524c3de6dde978a45bd882
Last active March 5, 2018 07:10
Go Vendoring源码阅读笔记与用法分析

为什么引入Vendoring机制?

Go1.5之后有一些比较重要的改动,其中包含Vendoring的支持,本文从使用和源码实现整理了一些备忘录,难免有疏漏,各位看官多指教。

没有引入Vendoring机制时,Go项目组织主要有两种方案:

  • 直接把项目放到GOPATH下面[详见: 附录1]
  • 项目放到GOPATH外,修改GOPATH来使用Go Command[详见: 附录2]

第三方依赖管理的灵活性和便捷性要求Go加入一种新机制,在不打破现有GOPATH假设的情况下,扩展GOPATH的package查找能力,这就是本文中介绍的Vendoring机制.

architectures and whatnot

  1. plain ol' React
let state = initial
render(view(state), element)
  • view is pure!
@Jpoliachik
Jpoliachik / index.ios.js
Last active August 17, 2021 10:27
ReactNative LayoutAnimation Example
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active April 2, 2024 20:18
Moving to ES6 from CoffeeScript

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@elvisw
elvisw / mirrorlist.mingw32
Last active January 20, 2022 22:43
MSYS2国内源
##
## 32-bit Mingw-w64 repository mirrorlist
## Changed on 2014-11-15
##
##中国科学技术大学开源软件镜像
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686
##北京理工大学镜像
Server = http://mirror.bit.edu.cn/msys2/REPOS/MINGW/i686
##日本北陆先端科学技术大学院大学 sourceforge 镜像
Server = http://jaist.dl.sourceforge.net/project/msys2/REPOS/MINGW/i686
@Barbery
Barbery / nginx.conf
Last active March 28, 2016 05:31
reverse proxy gist
server {
listen 80;
server_name gist.stutostu.com;
access_log off;
resolver 8.8.8.8;
location / {
proxy_pass https://gist.github.com$request_uri;
proxy_connect_timeout 6s;
proxy_set_header Accept-Encoding "";
@fhferreira
fhferreira / CORS.php
Last active April 30, 2023 16:49
Try to create - Cors Filter Laravel 5 Middleware
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Routing\Middleware;
use Illuminate\Http\Response;
class CORS implements Middleware {
/**
* Handle an incoming request.
@v5tech
v5tech / ffmpeg.md
Last active January 16, 2024 09:19
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"