Skip to content

Instantly share code, notes, and snippets.

View hoorayimhelping's full-sized avatar

Bucky Schwarz hoorayimhelping

View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
"Id","Activity","User","IP Address","Time"
"659e69c024984c883dbde7ea","User role changed - alexk+q2@qawerk.com -> ADMIN","alexk+q15@qawerk.com","46.119.235.147","2024-01-10 09:56:16.242000000"
"659e69bb24984c883dbde7c7","User role changed - alexk+q2@qawerk.com -> DEVELOPER","alexk+q15@qawerk.com","46.119.235.147","2024-01-10 09:56:11.552000000"
"659e69b624984c883dbde7a1","User removed from organization - Alex K","alexk+q15@qawerk.com","46.119.235.147","2024-01-10 09:56:06.294000000"
"659e681d023de7d8db311061","Service started - n","alexk+q15@qawerk.com","46.119.235.147","2024-01-10 09:49:17.831000000"
"659e67e9023de7d8db31102e","Service stopped - n","alexk+q15@qawerk.com","46.119.235.147","2024-01-10 09:48:25.511000000"
"659e5c9b7049c1364522ad11","Awaking instance","alexk+q15@qawerk.com","46.119.235.147","2024-01-10 09:00:11.715000000"
"659e592cba24b0a22590b009","User joined organization - alexk+q15@qawerk.com","alexk+q15@qawerk.com","46.119.235.147","2024-01-10 08:45:32.756000000"
"659e592cba24b0a225

Write a function that takes an array [1, 2, [3, 4, [5], 6], 7] and returns the sum of all elements where each element is multiplied by its depth. In this example:

(1 * 1) + (2 * 1) + (3 * 2) + (4 * 2) + (5 * 3) + (6 * 2) + (7 * 1) = 51

hint: recursion makes this simpler to implement

sample input:

@hoorayimhelping
hoorayimhelping / concepts.md
Last active February 2, 2022 22:49
Useful Software Engineering Concepts and Links

Resources to help software engineers

This is a list of resources I keep sharing with people that I find incredibly useful when it comes to building software.

Tactics when Creating Code

Applicable to day-to-day writing and maintaining software systems

  • Rule of Three - The wrong abstraction is much worse than code duplication
  • Do The Simplest Thing that could Possibly Work - Stop trying to find the general solution and solve the problem as simply as possible
  • YAGNI - you ain't gonna need it. Code for the problem you know you have right now, not the problem you think you'll have in the future
  • Fire and Motion - If you're stuck, just start coding something, even if you're not sure it's the right thing to code
{"sources":["https://raw.githubusercontent.com/influxdata/community-templates/master/csgo/csgo.yml"],"stackID":"","diff":{"buckets":[{"id":0,"stateStatus":"new","templateMetaName":"naughty-merkle-72f003","kind":"Bucket","new":{"name":"csgo","description":"","retentionRules":null},"old":null}],"checks":null,"dashboards":[{"id":0,"stateStatus":"new","templateMetaName":"dreamy-germain-f2f001","kind":"Dashboard","new":{"name":"CSGO (Counter Strike: Global Offensive)","description":"","charts":[{"properties":{"shape":"chronograf-v2","queries":[{"text":"from(bucket: \"csgo\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_csgo\")\n |> filter(fn: (r) => r[\"_field\"] == \"playerstats_stats_last_match_kills_value\")\n |> aggregateWindow(every: v.windowPeriod, fn: last)\n |> yield(name: \"last\")","editMode":"advanced","name":"","builderConfig":{"buckets":[],"tags":[{"key":"_measurement","values":[""],"aggregateFunctionType":"filter"}],"functions":[
diff --git a/vendor/golang.org/x/tools/cmd/goimports/goimports.go b/vendor/golang.org/x/tools/cmd/goimports/goimports.go
index 2cca29235..c195caaf8 100644
--- a/vendor/golang.org/x/tools/cmd/goimports/goimports.go
+++ b/vendor/golang.org/x/tools/cmd/goimports/goimports.go
@@ -160,7 +160,12 @@ func processFile(filename string, in io.Reader, out io.Writer, argType argumentT
// filename is "<standard input>"
return errors.New("can't use -w on stdin")
}
- err = ioutil.WriteFile(filename, res, 0)
+ // On Windows, we need to re-set the permissions from the file. See golang/go#38225.
############# ########
############# ##############
############# ##################
############# ######################
######## ########################
####### ##########################
###### ############################
###### ################ ######
##### ############## ####
##### ############## ####
import amplitude from 'amplitude-js'
import {AMPLITUDE_API_KEY} from 'src/shared/constants'
class Event {
constructor() {
this.amplitude = amplitude.getInstance()
if (ENABLE_AMPLITUDE) {
this.amplitude.init(AMPLITUDE_API_KEY)
}
[24/Jul/2019 16:11:59] "GET /clients/ HTTP/1.1" 200 76760
[24/Jul/2019 16:11:59] "GET /static/dist/redesign_style-87bf31f2fbabac3a6cf3.css HTTP/1.1" 304 0
[24/Jul/2019 16:12:00] "GET /static/dist/leasing_anonymous_tenant_board-87bf31f2fbabac3a6cf3.css HTTP/1.1" 304 0
[24/Jul/2019 16:12:00] "GET /static/dist/redesign_base-87bf31f2fbabac3a6cf3.bundle.js HTTP/1.1" 304 0
[24/Jul/2019 16:12:00] "GET /static/dist/leasing_anonymous_tenant_board-87bf31f2fbabac3a6cf3.bundle.js HTTP/1.1" 304 0
[24/Jul/2019 16:12:00] "GET /static/dist/frontend_setup-87bf31f2fbabac3a6cf3.bundle.js HTTP/1.1" 304 0
[24/Jul/2019 16:12:00] "GET /static/dist/messages-87bf31f2fbabac3a6cf3.bundle.js HTTP/1.1" 304 0
[2019-07-24 16:12:01] INFO {"type": "confirm_human", "participant": "session:uh85hbkf8aywf4f9ijtkn13n2l7jwhm8"}
[24/Jul/2019 16:12:01] "POST /experiments/confirm_human/ HTTP/1.1" 204 0
Internal Server Error: /api/tenants/
diff --git a/static/jsx/activity_feed.tsx b/static/jsx/activity_feed.tsx
index 217882f5f..1425da3cd 100644
--- a/static/jsx/activity_feed.tsx
+++ b/static/jsx/activity_feed.tsx
@@ -41,7 +41,9 @@ const rootReducer = combineReducers({
activitiesState,
buildingDetailsState,
paginationState,
-});
+} as any);
const simpleAsyncOperation = () => Promise.resolve();
for (var i = 0; i < 10; i++) {
simpleAsyncOperation().then(() => {
console.log(i);
});
}