type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
// avcodec_sample.0.5.0.c | |
// Original source: | |
// http://web.me.com/dhoerl/Home/Tech_Blog/Entries/2009/1/22_Revised_avcodec_sample.c.html | |
// | |
// A small sample program that shows how to use libavformat and libavcodec to | |
// read video from a file. | |
// | |
// This version is for the 0.4.9+ release of ffmpeg. This release adds the | |
// av_read_frame() API call, which simplifies the reading of video frames |
/** | |
* Format a date like YYYY-MM-DD. | |
* | |
* @param {string} template | |
* @param {Date=} [date] | |
* @return {string} | |
* @license MIT | |
*/ | |
function formatDate(template, date) { | |
var specs = 'YYYY:MM:DD:HH:mm:ss'.split(':'); |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
#!/usr/bin/env xcrun swift | |
// Adapted from | |
// https://forums.developer.apple.com/thread/5137 | |
// https://joearms.github.io/2016/01/04/fun-with-swift.html | |
import WebKit | |
class ApplicationDelegate: NSObject, NSApplicationDelegate { | |
internal var window: NSWindow |
Generally, the Git proxy configuration depends on the Git Server Protocol you use. And there're two common protocols: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080
. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.
When you do git clone ssh://[user@]server/project.git
or git clone [user@]server:project.git
, you're using the SSH protocol. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config
:
ProxyCommand nc -x localhost:1080 %h %p
const settings = require('electron-settings'); | |
dialog | |
.showOpenDialog(mainWindow, { | |
properties: ['openDirectory'], | |
securityScopedBookmarks: true, | |
}) | |
.then(({ canceled, filePaths, bookmarks }) => { | |
// If the dialog was canceled or no directory/file selected we don't want to do anything | |
if (canceled || filePaths.length === 0) { |