Skip to content

Instantly share code, notes, and snippets.

View thanley11's full-sized avatar

thanley11

  • Sync1 Systems
  • West Chester, PA
View GitHub Profile
async getPlaces(latLng, maxResults) {
try {
const places = await this._placeServer.getNearbyPlaces(latLng, maxResults);
const getAllImageUrls = places.map(async (p) => {
let url = await this._imageServer.getImageForPlace(p.placeName, p.latLng);
let place = this._placeServer.getPlaceAt(p.placeName, p.latLng);
return new CompletePlaceData(place._placeName, place["_latLng"]._latitude, place["_latLng"]._longitude, place._address, place._priceLevel, place._rating, url);
});
return await Promise.all(getAllImageUrls);
} catch(error){
@thanley11
thanley11 / streamenhancer.py
Created February 18, 2019 01:30
Play b64 encoded stream in mpv
import json
import base64
import argparse
from subprocess import run, PIPE
parser = argparse.ArgumentParser()
parser.add_argument("b64", help="b64 string for stream", type=str)
args = parser.parse_args()
parsed = args.b64.split('streamenhancer://', 1)[1]
@thanley11
thanley11 / dotnetconfig.md
Last active February 13, 2019 16:52
Dot net core configuration setup

How to use config in dot net core

This env variable determines which appsettings.json file is used

name value
ASPNETCORE_ENVIRONMENT Development

If set to Development, it will use the values from appsettings.Development.json

@thanley11
thanley11 / sqlXml.sql
Created September 19, 2018 18:13
Handling XML in SQL
DECLARE @myDoc xml ;
SET @myDoc =
'<Root>
<Location LocationID="10" >
<step>Manufacturing step 1 at this work center</step>
<step>Manufacturing step 2 at this work center</step>
</Location>
</Root>' ;
SELECT @myDoc ;
@thanley11
thanley11 / auditTable.sql
Created September 18, 2018 19:19
Audit Table with parent and children
USE DW
/* Drop table dbo.dim_audit */
IF EXISTS ( SELECT *
FROM dbo.sysobjects
WHERE id = OBJECT_ID(N'[dbo].[dim_audit]')
AND OBJECTPROPERTY(id, N'IsUserTable') = 1 )
DROP TABLE dbo.[dim_audit]
GO
CREATE TABLE [dbo].[dim_audit](
@thanley11
thanley11 / .asoundrc
Created February 27, 2016 18:39
Example asoundrc file
# Posted at http://dl.dropbox.com/u/18371907/asoundrc
# Info: http://www.sabi.co.uk/Notes/linuxSoundALSA.html
# Soundcard roundup: http://forums.gentoo.org/viewtopic-p-4192284.html#4192284
# Show programs currently opening ALSA:
# fuser -fv /dev/snd/* /dev/dsp*
# Show opened settings:
# cat /proc/asound/card0/pcm0p/sub0/hw_params
filetype off
call pathogen#infect()
call pathogen#helptags()
set nocompatible " get rid of Vi compatibility mode. SET FIRST!
filetype plugin indent on " filetype detection[ON] plugin[ON] indent[ON]
set t_Co=256 " enable 256-color mode.
syntax enable " enable syntax highlighting (previously syntax on).
colorscheme desert " set colorscheme
set number " show line numbers
set laststatus=2 " last window always has a statusline
USE [db]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[load_pids]
@Skip AS INT,
@Take AS int