Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgwill/092da063fda92cb60fc3fd832e169aa6 to your computer and use it in GitHub Desktop.
Save jgwill/092da063fda92cb60fc3fd832e169aa6 to your computer and use it in GitHub Desktop.
@stcgoal Create Gist really quickly when experimenting

#--@STCGoal Create Gist really quickly when experimenting

##--@STCIssue Why creating Gist when Experimenting ?


Well, what else ??

Here is what created that content anyway

 const GitHub = require("github-api");

 // basic auth
var gh = new GitHub({
 //@STCGoal Create Gist really quickly when experimenting
 //@STCIssue Why creating Gist when Experimenting ?

    token: 'A TOKEN WITH ONLY GIST CREATE PERMISSION'
    /* also acceptable:
       username: 'jgwill',
    password: 'MYPASSWORD'
     */
 });


// const gh = new GitHub();
let gist = gh.getGist(); // not a gist yet
gist.create({
   public: true,
   description: '@STCGoal Create Gist really quickly when experimenting',
   files: {
      "x__github_api__nodejs__2012030818.dissimination-method-.md": {
         content: "#--@STCIssue Why creating Gist when Experimenting ?\n\n* Some bullet point on it"
      }
   }
}).then(function({data}) {
   // Promises!
   let createdGist = data;
   return gist.read();
}).then(function({data}) {
   let retrievedGist = data;
   // do interesting things
});
const GitHub = require("github-api");
// basic auth
var gh = new GitHub({
token: 'A TOKEN WITH ONLY GIST CREATE PERMISSION'
});
// const gh = new GitHub();
let gist = gh.getGist(); // not a gist yet
gist.create({
public: true,
description: '@STCGoal Create Gist really quickly when experimenting',
files: {
"x__github_api__nodejs__2012030818.dissimination-method-.md": {
content: "#--@STCIssue Why creating Gist when Experimenting ?\n\n* Some bullet point on it"
}
}
}).then(function({data}) {
// Promises!
let createdGist = data;
return gist.read();
}).then(function({data}) {
let retrievedGist = data;
// do interesting things
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment