Skip to content

Instantly share code, notes, and snippets.

View jdx's full-sized avatar

jdx

View GitHub Profile
func Update(channel string) {
golock.Lock(updateLockPath)
defer golock.Unlock(updateLockPath)
done := make(chan bool)
go func() {
updateCLI(channel)
updatePlugins()
touchAutoupdateFile()
done <- true
}()
func fileExists(path string) (bool, error) {
var err error
if runtime.GOOS == "windows" {
// Windows doesn't seem to like using os.Stat
_, err = os.Open(path)
} else {
_, err = os.Stat(path)
}
if err != nil {
if os.IsNotExist(err) {
@jdx
jdx / aliases.js
Created May 1, 2015 00:05
heroku toolbelt v4 aliases
module.exports.aliases = [
{
from: 'apps',
to: 'apps:info'
}
];
@jdx
jdx / hello.js
Created April 2, 2015 00:01
colors in heroku CLI plugin
'use strict';
var chalk = require('chalk');
exports.topics = [{
name: 'hello',
description: 'a topic for the hello world plugin'
}];
exports.commands = [
{
var sourceUrl = context.args['source-url'];
someotherpromsie()
.then(function() {
if (sourceUrl) { return sourceUrl; }
return uploadCwdToSource(app, context.cwd);
})
.then(function(sourceGetUrl) {
console.log(sourceGetUrl);
})
var sourceUrl = context.args['source-url'];
function sourceUrlPromise() {
if (sourceUrl) { return Promise.resolve(sourceUrl); }
return uploadCwdToSource(app, context.cwd);
}
sourceUrlPromise()
.then(function(sourceGetUrl) {
console.log(sourceGetUrl);
@jdx
jdx / heroku.md
Last active August 29, 2015 14:17 — forked from geemus/heroku.md

TODO empty arrays and/or nil values (see apps:info)

General Guidelines

  • Use full sentences, including punctuation.
  • Labels should be provided where needed in the form of 'Labels labels:'.
  • Commands should have one newline between the header and body and another after the body.
  • Alpha-sort arrays before display and display labeled data in alpha-sorted key order.
@jdx
jdx / samo-2.md
Last active August 29, 2015 14:09
Santa Monica TV part 2

In this first section, I will be building the HTML and CSS for the application to create a non-functional mockup.

To begin, I'll start with the structure of the app and write all of the HTML.

HTML is made up of 'tags'. A tag has 3 parts, a beginning and closing tag with any text in the middle. This is an h1 or header tag. It is used to title pages.

<h1>Welcome to our game!</h1>

There are other types of header tags, h1, h2, through h6. As the number increases, the text gets smaller. If I change it to h3, you can see it get a bit smaller.

foo
**bar**
```{r engine='Rcpp'}
#include <Rcpp.h>
// [[Rcpp::export]]
int fibonacci(const int x) {
if (x == 0 || x == 1) return(x);
@jdx
jdx / uninstall-heroku.md
Last active August 29, 2015 14:07
Uninstall Heroku

To uninstall the Heroku Toolbelt on OSX (non-Homebrew) or Standalone Linux install:

rm -rf /usr/local/heroku
rm -rf ~/.heroku

For Homebrew: