Skip to content

Instantly share code, notes, and snippets.

View mchirico's full-sized avatar
💭
Kubernetes... API Server Development

Mike Chirico mchirico

💭
Kubernetes... API Server Development
View GitHub Profile
@mchirico
mchirico / server.go
Last active August 27, 2020 13:19
Simple Go Web Server
package main
import (
"log"
"net/http"
)
func main() {
log.Println("starting server...")
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`Hello world`))
})
/*
go get ./...
go run *.go -kubeconfig=/home/runner/.kube/config
from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://mail.google.com/']
@mchirico
mchirico / sinonFirebaseFake.ts
Created July 9, 2020 15:06
Needs to be cleaned up... sinon fake..
import "mocha";
import { expect } from "chai";
import { set, db } from "../src/firebasekick";
import * as sinon from "sinon";
import * as firebase from "@firebase/testing";
import admin from "firebase-admin";
import DocumentReference = admin.firestore.DocumentReference;
import DocumentData = admin.firestore.DocumentData;
// stub(obj, 'meth').callsFake(fn)
cluster:
name: cluster
privateKey: cluster-key
machines:
- count: 1
spec:
image: quay.io/mchirico/centos7
name: node%d
portMappings:
- containerPort: 22
def getID(x):
idX0 = Function2id.get(x[0],-1)
return idX0
d['FunID']=d[['Function']].apply(getID, axis=1);

X = df.drop('price', axis=1) # get all but price column y = df['price'] X.head(3)

Way to get series...

prices = df.price

aipiggybot Mike Chirico

Keybase proof

I hereby claim:

  • I am mchirico on github.
  • I am aipiggybot (https://keybase.io/aipiggybot) on keybase.
  • I have a public key ASD5VLT9qs5D_syN-NiAQu0jTz3KmKWb30Sb5oZEKeEGmgo
@mchirico
mchirico / package.json
Created March 7, 2020 20:18
Summary of changes
"scripts": {
"pretest": "./node_modules/.bin/eslint src/*.js",
"test": "./node_modules/.bin/nyc mocha",
"testw": "mocha -w",
"coverage": "./node_modules/.bin/nyc --reporter=lcov --reporter=text --reporter=text-summary mocha -- --timeout=3000 test/**/*.js && codecov -p ../ -t ${CODEC\
OV_TOKEN}"
},
"husky": {
"hooks": {
"pre-commit": "npm run pretest"
@mchirico
mchirico / eslintrc.yml
Created March 7, 2020 20:13
Eslint file
env:
commonjs: true
es6: true
node: true
extends: 'eslint:recommended'
globals:
Atomics: readonly
SharedArrayBuffer: readonly
parserOptions:
ecmaVersion: 2018