Skip to content

Instantly share code, notes, and snippets.

View joekrump's full-sized avatar
🌱

Joe Krump joekrump

🌱
View GitHub Profile
@joekrump
joekrump / memory_leak_angular.md
Last active January 28, 2020 00:29
AngularJS and memory leaks

Listeners registered to scopes and elements are automatically cleaned up when they are destroyed, but if you registered a listener on a service, or registered a listener on a DOM node that isn’t being deleted, you’ll have to clean it up yourself or you risk introducing a memory leak.

Best Practice: Components should clean up after themselves. You can use the $onDestroy() AngularJS component lifecycle hook to run a clean-up function when the component is removed. An older way of doing this would have been to add an event handler for element.on('$destroy', …) or scope.$on('$destroy', …) for an AngularJS Directive.

Question:

I have a

element.on("click", (event) => {...});

>```

@joekrump
joekrump / cloudSettings
Last active October 23, 2019 22:08
VSCode settings sync
{"lastUpload":"2019-10-21T16:31:30.783Z","extensionVersion":"v3.4.3"}
@joekrump
joekrump / vs.code-snippets
Created March 27, 2019 04:53
VS Code Code Snippets
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
"Print to console": {
"scope": "javascript,typescript",
@joekrump
joekrump / demo.md
Last active March 25, 2019 20:06
FEI Team Demo - Apollo Feature Flags
@joekrump
joekrump / tracking_test_plan.md
Created March 19, 2019 21:13
Test plan for a segment event

Tests

  1. Open Segment to view events fired from beta instances.
  2. Log into this beta using email address demo@clio.com ...
  3. On the Segment debugger page, a new "page" event has been received.
  4. Click on the event in the list
  5. In the panel that opens on the right, click on the "Raw" tab.
  6. Within the data of properties, the data for url contains a path that has a value that is correct and not equal to "REDACTED".
@joekrump
joekrump / get_matching_files
Last active July 25, 2019 16:23
Get the file names of files matching an extension, within a directory
#!/usr/bin/env ruby
directory = ARGV[0] || './client-src'
file_extension = ARGV[1] || '.coffee'
def get_matching_files_in(directory, file_extension)
manage_ui_files = []
accounting_files = []
payment_files = []
billing_files = []
@joekrump
joekrump / vs_code_extensions.md
Last active February 27, 2019 22:22
VS Code Extensions

Extensions

Generated by running code --list-extensions

  • 2gua.rainbow-brackets
  • andys8.jest-snippets
  • ChakrounAnas.turbo-console-log
  • christian-kohler.path-intellisense
  • dbaeumer.vscode-eslint
  • DotJoshJohnson.xml

My VS Code extensions

code --install-extension NuclleaR.vscode-extension-auto-import
code --install-extension dbaeumer.vscode-eslint
code --install-extension dzannotti.vscode-babel-coloring
code --install-extension eg2.tslint
code --install-extension passionkind.prettier-vscode-with-tabs