This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
def info(msg, **kwargs): | |
_log(msg, logging.info, kwargs) | |
def warning(msg, **kwargs): | |
_log(msg, logging.warning, kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import sys | |
import select | |
cmd = 'git clone --progress https://github.com/jonmorehouse/dotfiles foobar' | |
p = subprocess.Popen(cmd.split(' '), stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
while True: | |
reads = [p.stdout.fileno(), p.stderr.fileno()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (b *bigqueryGithubDataSink) executeQuery(queryStr string, cb func([]bigquery.Value, error) error) (context.CancelFunc, error) { | |
if !b.isInitialized() { | |
return nil, ErrDataSinkNotInitialized | |
} | |
transactionContext, cancelFunc := context.WithTimeout(b.clientContext, b.opts.ReadTransactionTimeout) | |
query := b.client.Query(queryStr) | |
rowIterator, err := query.Read(transactionContext) | |
if err != nil { | |
return cancelFunc, err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <vector> | |
#include "os.h" | |
using namespace std; | |
//function prototypes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = g++ | |
CFLAGS = -g -Wall -Wvla -Wshadow -Wunreachable-code -Wconversion -Wno-sign-conversion -Wno-sign-compare -Wno-write-strings -fdiagnostics-color=always | |
all: | |
$(CC) $(CFLAGS) filesys.cpp mlist.cpp os.cpp -o filesys | |
clean: | |
rm -f *.o filesys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"meta": { | |
"data_type": "Doctor", | |
"total": 1, | |
"count": 1 | |
}, | |
"data": { | |
"practices": [ | |
{ | |
"location_slug": "ca-san-bernardino", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uri = '/httpbin/headers' | |
# we want to strip the `/httpbin` off the front | |
new_uri = uri.lstrip('/httpbin') | |
# this returns 'eaders' because it treats the input into lstrip as a set of characters to strip. So it strips all of | |
# those characters until it finds something that is not in one of those (e) | |
# now, let's try with something more predictable | |
uri = '/httpbin/status' | |
# this returns status, as expected! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~programs/kara-patient-derived-views-ui (master*)$ ds view debug --prefix=cli-events debug_op=resource-state | |
starting datastore-cli... | |
viewing 3afa28c7-cefc-4198-851c-8b861c0c4529 | |
created 3 minutes ago | |
{ | |
"component-idx": 0, | |
"created_at": 1609891937, | |
"debug_id": "c098e50b-a5b3-49b8-b3f9-4dbf224021c2", | |
"debug_op": "resource-state", | |
"debug_state": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cmd | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"github.com/hashicorp/waypoint/pkg/server/gen" | |
"github.com/powertoolsdev/go-common/config" | |
"github.com/powertoolsdev/go-common/shortid" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project = "abc" | |
app "mario" { | |
build { | |
use "docker-pull" { | |
image = "pengbai/docker-supermario" | |
tag = "latest" | |
disable_entrypoint = true | |
} | |
} |