Skip to content

Instantly share code, notes, and snippets.

View edwindotcom's full-sized avatar
:octocat:
hubba hubba

Edwin Wong edwindotcom

:octocat:
hubba hubba
  • Alameda, CA
View GitHub Profile
@edwindotcom
edwindotcom / convert.py
Created June 5, 2020 16:41
convert inches to foot-inches
import sys
import math
def inch_to_ft_inch(inches):
ft = math.floor(int(inches)/12)
ret_inch = int(inches) % 12
return ft, ret_inch
val = inch_to_ft_inch(sys.argv[1])
print("{}\' {}\"".format(int(val[0]), val[1]))
curl -H "Authorization: token TOKEN" \
-H 'Accept: application/vnd.github.v3+json' \
"https://api.github.com/repos/github/service-catalog-demo/dispatches" \
-d '{"event_type": "trigger", "client_payload": {"filename": "2020-08-11-foo123", "title": "Hi Mom", "status": "Major outage"}}'
curl \
-H "Authorization: token TOKEN" \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/github/service-catalog-demo/deployments \
-d '{"ref":"master", "environment":"amy-dev-svr"}'
@edwindotcom
edwindotcom / getMyRepos.gql
Last active September 21, 2020 22:33
github graphql - get logged in users repos
{
viewer {
repositories(first: 10) {
totalCount
nodes {
name
url
nameWithOwner
}
@edwindotcom
edwindotcom / gist:17005f658976a552905f013183ba1db3
Last active September 21, 2020 22:43
github gql - search by most stars
query SearchMostTop10Star($queryString: String!, $number_of_repos:Int!) {
search(query: $queryString, type: REPOSITORY, first: $number_of_repos) {
repositoryCount
edges {
node {
... on Repository {
name
url
description
stargazers {totalCount}