Skip to content

Instantly share code, notes, and snippets.

View d2lam's full-sized avatar
💭
🤷‍♀️

Dao Lam d2lam

💭
🤷‍♀️
View GitHub Profile

Keybase proof

I hereby claim:

  • I am d2lam on github.
  • I am d2lam (https://keybase.io/d2lam) on keybase.
  • I have a public key whose fingerprint is 0CF2 E0E8 33B3 F4AE D2BF D09C E450 25C1 9A7B A4B7

To claim this, I am signing this object:

#!/bin/bash
usage() { echo "Usage: sd-cmd exec sd/getJobId@<VERSION> [-p] [-j]"; }
while getopts 'p:j:u:' option; do
case "${option}" in
p) PIPELINE_ID=${OPTARG};;
j) JOB_NAME=${OPTARG};;
u) URL=${OPTARG};;
*) usage;;
esac
'use strict';
const API_URL = 'https://beta.api.screwdriver.cd/v4';
const Models = require('screwdriver-models');
// Setup Datastore
const datastoreConfig = config.get('datastore');
const DatastorePlugin = require(`screwdriver-datastore-${datastoreConfig.plugin}`);
const datastore = new DatastorePlugin(datastoreConfig[datastoreConfig.plugin]);
@d2lam
d2lam / syncWebhooks.js
Created January 8, 2018 21:35
Syncing webhooks for all projects
/** Need to configure API_URL and USER_TOKEN
*/
'use strict';
const Promise = require('promise');
const request = require('request-promise');
const API_URL = 'https://beta.api.screwdriver.cd/v4/pipelines';
const USER_TOKEN = process.env.USER_TOKEN;
const getPipelinesOptions = {
@d2lam
d2lam / test.yaml
Last active April 21, 2017 18:29
Test parser
workflow:
- publish
shared:
image: node:6
jobs:
main:
steps:
- install: npm install
@d2lam
d2lam / index.js
Created February 28, 2017 00:45
Gitlab stuff
/* eslint no-underscore-dangle: ["error", { "allowAfterThis": true }] */
'use strict';
const Breaker = require('circuit-fuses');
const Request = require('request');
const Hoek = require('hoek');
const Joi = require('joi');
const Schema = require('screwdriver-data-schema');
const Scm = require('screwdriver-scm-base');
@d2lam
d2lam / jwttest.go
Created January 26, 2017 23:42
JWT validation
package main
import (
"fmt"
"io/ioutil"
"github.com/screwdriver-cd/jwt/jwt-go"
)
func main() {

Keybase proof

I hereby claim:

  • I am d2lam on github.
  • I am d2lam (https://keybase.io/d2lam) on keybase.
  • I have a public key whose fingerprint is 970B 2621 48EE 1C16 8F5B 24F1 9034 D26B C16E 8375

To claim this, I am signing this object: