Skip to content

Instantly share code, notes, and snippets.

View hoorayimhelping's full-sized avatar

Bucky Schwarz hoorayimhelping

View GitHub Profile

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);
});
}
diff --git a/broker/templates/broker/activity_feed.html b/broker/templates/broker/activity_feed.html
index d27bfd402..8ad1117eb 100644
--- a/broker/templates/broker/activity_feed.html
+++ b/broker/templates/broker/activity_feed.html
@@ -1,7 +1,5 @@
{% extends 'internal.html' %}
{% load render_bundle from webpack_loader %}
-{% load socialaccount %}
-{% load staticfiles %}