Random Flashcards
xcopy recurse
/e
xcopy no prompt
/y
rmdir with non-empty directory
rmdir ___ /y
use “for” to recursively copy files
for /r C:\Folder %f in (*.png) do @copy “%f” C:\png
endpoint where “add data field” hits
CompanyContactController
Where does this live in the database? applicationUser.CompanyUserPermissions.IsCompanySystemAdmin
straight-up on the User table
Hipchat: /code ___
format
Hipchat: /quote ___
special formatting
Hipchat: /clear
…
Hipchat: /me
Chat about yourself in the third person
Hipchat emoticons work like this: (taco)
can add custom ones easily
table modified when user hits “add field” endpoint
CompanyRoomContactField
CompanyRoomContactField structure
1 row per company; CompanyId and a JSON details field { “RoomContactTypeId”: “lisagent”, “RoomContactTypeName”: “Listing Agent”, “ContactIndex”: 3, “UpdatedDisplayName”: “Listing Agent 151”, “RoomContactFields”: [ { “RoomContactFieldId”: “name”, “RoomContactFieldName”: “Name”, “IsShownToAll”: false, “IsRequiredOnSubmit”: false, “IsRequiredOnCreate”: false, “UpdatedDisplayName”: null },
speed up Visual Studio (Code Lens specifically)
Tools > Options > Text Editor > All Languages > Code Lens > Turn everything off except Show References
speed up Visual Studio (Code Lens specifically)
Tools > Options > Text Editor > All Languages > Code Lens > Turn everything off except Show References
All DTR textboxes and selects have the class ___
input-text and input-select
how to do serve-from-disk
two terminals: 1) npm build –watch; 2) lite-server –base-dir=”dist”
LINQ DefaultIfEmpty
Returns the elements of the specified sequence or the type parameter’s default value in a singleton collection if the sequence is empty
Recursive rename from command line
for /R %x in (*.m4v) do ren “%x” *.avi
TS declare keyword
tell TS you’re referencing code that exists elsewhere
if a file has the extension .d.ts then
each root level definition must have the declare keyword prefixed to it. This helps make it clear to the author that there will be no code emitted by TypeScript. The author needs to ensure that the declared item will exist at runtime
VSC “box select”
Ctrl-Alt-Shift-arrows
Ctrl-Shift-L
select all instances of a string
trying out Bookmarks VSC extension
…
Ctrl-Alt-K
toggle bookmark
Ctrl-Alt-L, Ctrl-Alt-J
next bookmark, prev bookmark
for /f
parse lines in a text file for /f “tokens=1 delims=(“ %x in (iss.txt) do @echo %x
set up ww inner and outer iis sites, ports
4210, 4211
declare need for explicit Angular injection of primitive type
constructor(@Inject(‘para’) _para:string)
set up provider for Angular injection of primitive type
add to providers: { provide: ‘key’, useValue: ‘myvalue’ }
multiple modules with the same name differing only by casing error
clean up npm; make sure casing is identical in all import statements
because the database used to return biz strings…
DTRDatabaseException can still be considered a biz-tier exception
how to find the Code Review Checklist in Confluence
Developer Information / Standards and Policies / Code Review Checklist
new pull request steps
After Merge to Develop branch add Build # from Distelli to JIRA as comment and tag with next release label UI changes must have screen shot in Pull Request showing new UI
what does it mean to “tag with next release label”
?
does something generate RoomFields.resx?
…
i like that bree and koz remember more about the dynamicMenu angular stuff than I do
…
Add’l thing if I want to refresh my postman from the shared one (this isn’t covered by “git pull”)
build postmansetup
making my local database have permission to run Postman tests
Give iis apppool user access to your sql server database (my apppool for port 53134 is “dtr”), so user would be IIS APPPOOL\dtr)
newman is used for
converting json files to XML test output (Postman-related)
run just postman tests
build PostmanTest
IIS APPPOOL\dtr should be edited to have the following user roles
db_owner on Cartavi
what’s the diff between PostmanSetup and PostmanDownload?
PostmanDownload pulls from “your cloud Postman” to the local file (use only if you’ve changed something); PostmanSetup pushes from your local file to “your cloud Postman”
what does “build TestAll” do
run unit, integration, and Postman tests
install casper
install phantomjs or slimerjs, then “npm install casperjs” (install npm types for phantomjs and casperjs too)
slimerjs vs phantomjs
Contrary to PhantomJS, SlimerJS is not headless: you see windows and it needs a graphical environment
ghostjs
Side note: If you can use ES7, take a look at ghostjs, which supports the new async/await syntax
I didn’t even know that npm contained stuff that isn’t node libraries
Is CasperJS a node.js library? No. CasperJS is written on top of PhantomJS, which is a node-independent Qt/WebKit based library. If you try to run your CasperJS script with node, it just won’t work out of the box. Hint: If you want to drive CasperJS from node, try SpookyJS
is PhantomJS a node.js library?
No - it’s a node-independent Qt/WebKit based library
SpookyJS is no longer maintained
If you are simply looking to control Phantom from Node and don’t need Casper’s API, have a look at PhantomJS 1.8, which has native WebDriver support
if you need to open URLs from node instead of the command line
npm install opn
phantomjs is an old npm name
use phantomjs-prebuilt instead
you transpile the .js script from .ts, which is then fed into the Phantom command line
and not run from node, as assumed
page.evaluate(…JS…)
var title = page.evaluate(function() { return document.title; }); console.log(‘Page title is ‘ + title);
inside a basic phantomjs script
var page = require(‘webpage’).create(); page.open(‘http://www.cnn.com’, function (status) { }, function(status) { // This is oddly the one that is called });
sample of DOM selection within a phantom script
var ua = page.evaluate(function() { return document.querySelectorAll(‘.cd__headline-text’).textContent; });
page.evaluate() must return something JSON serializable
…
allow capture of console messages executed during evaluate() calls
page.onConsoleMessage = function (msg) { console.log(msg); }
specify phantom cookies
–cookies-file=/path/to/cookies.txt
how do you add an admin in a FB group
go to that member; click Make Admin
fb admin vs moderator
admins are superset; can make other members moderators, edit core group info, etc.
to run casper, feed a script that uses it into phantom, as in
phantomjs casperjs.js sample.js
run Jasmine tests
build JasmineTest
Jasmine configuration lives in
Cartavi.WebMvc.Ui.Jasmine/Chutzpah
should I install Chutzpah vs extension
…
TS –strict
opt into a strict-by-default mode so that you enjoy all the benefits of better type safety without having to enable each compiler option separately
–strict enables four strictness options
–strictNullChecks –noImplicitAny –noImplicitThis –alwaysStrict
override –strict for just one strictness option
{ “strict”: true, “alwaysStrict”: false }
do I need to import es6-shims to get around TS errors in swd-cli
…
–check-js
report errors in js files
July 27 Doomfist
…
If –lib is not specified a default library is injected. The default library injected is:
► For –target ES5: DOM,ES5,ScriptHost ► For –target ES6: DOM,ES6,DOM.Iterable,ScriptHost
is there no @types wrapper for es6-shims?
…
how do Angular CLI projects polyfill es6 stuff?
…
what is the core-js npm package?
…
can typescript do any kind of import on pure js?
…
how do I import everything from corejs?
…
–listEmittedFiles
tsc option
categories of “lib” options
JavaScript Bulk Feature (es5, es6, es2015, es7, es2016, es2017, esnext) Runtime Environment (dom, dom.iterable, webworker, scripthost) ESNext By-feature options (even smaller than bulk feature)
add a statsd counter
StatsdService.Counter(“QueueReadItems”, count, 1, tags);
add a statsd increment
StatsdService.Increment(“QueueProcessedItems”, 1, 1, tags);
how to initialize statsd in an Application_Start
StatsdConfiguration.Configure(“DTRJobs”);
what is statsd
a standard and, by extension, a set of tools that can be used to send, collect, and aggregate custom metrics from any application
how widespread is our use of statsd in the application?
…
learned that Angular CLI’s “” makes relative pathing not work
took it out
learned that Angular CLI’s “” makes relative pathing not work
took it out
if PostmanTest gives “couldn’t open file NewmanData/global-variables.json”
create that file containing “{}” in /buildscripts/NewmanData
Why do batch files sometimes just stop processing the rest of the commands?
…
if postman tests fail, how to learn more
open your own Postman, run the same test that failed, work with it there
if postman fails with ECONNREFUSED . . .
your IIS probably isn’t started
Do we need something special other than “placeholder” attribute
No
set up a BehaviorSubject from an existing observable
new BehaviorSubject(0).subscribe(myObservable)
set up a BehaviorSubject from an existing observable
new BehaviorSubject(0).subscribe(myObservable); will pass all 3 types of events
FOUT
flash-of-unstyled-text (FOUT)
Construct 3 web font support
You can import fonts in a range of formats, such as TTF or EOT, but we recommend Web Open Font Format (WOFF) which is now widely supported
installing Construct addons
Simply download the .c2addon file, then drag and drop the file in to the Construct 2 window
Construct 3 has three new editors
Dictionary, Array, and Text Editor (which can do custom XML or JSON files)
Both Array and Dictionary files can be requested at runtime with the AJAX object, and then the result loaded by the Array or Dictionary object
…
Spriter
2D sprite animation Use your Spriter animation files directly in your games to benefit from silky smooth tweened animations that take a fraction of the memory. Suddenly customizable player characters and smoothly animated giant on-screen bosses are a breeze Free version; pro is $59
What is Monogame
an efficient, flexible, cross platform API for developing 2D and 3D games (related to Xamarin)
Construct layers
Layers belong to a layout and can be added, edited and removed in the Layers Bar. Layers can be scrolled at different rates for parallax effects, and also individually scaled and rotated, which makes them a powerful way to make interesting visual effects in games.
at least once a week, maybe on the weekend, glance at this in Todoist
your active projects
A common arrangement for layers might be
HUD (top layer - health bar, UI info etc.) Foreground (main game objects) Middleground (a parallaxing background layer) Background (bottom layer - the background)
Layers can also have ___ applied, which affects all content appearing on the layer.
Layers can also have effects applied, which affects all content appearing on the layer.
global layers
Sometimes many layouts in a project have the same content on a particular layer, such as for interface or HUD overlaid on to the game. Changing this content then becomes a chore since changes must be repeated on every layout. Global layers are aimed at solving this problem. If a layer’s Global property is set to Yes, then every layer in the project with the same name is overridden by that layer. The initial objects, as well as its properties, are used instead of the other layer’s own content and properties.
layer setting “Use render cells”
Optimise the rendering of this layer for extremely large layouts with a large number of static objects spread out across this layer. This is not normally necessary except for certain types of large game. If this is used incorrectly, it can actually make rendering less efficient, so make sure you can measure a performance improvement before using it. For more information, see the blog post How render cells work.
Layer parallax
Change the rate at which the layer scrolls in the horizontal and vertical directions. A parallax rate of 100, 100 means ordinary scrolling, 0, 0 means it will never scroll (useful for UIs), 50, 50 means scrolling half as fast, etc.
Layer locking
Objects on locked layers cannot be selected
Construct objects
Plugins define a kind of object. For example, a Sprite is a kind of object. Javascript programmers can make new plugins (and behaviors) using the Javascript SDK.
All instances of an object type use its behaviors. You cannot add a behavior to only some of the instances
…
Construct effects
Effects change the visual appearance of an object. Effects do not work on all platforms, because it requires WebGL support. However, fallbacks can be set up so everything still appears reasonably when WebGL is not supported. Note effects are separate to the blend mode which is supported on all platforms.
Construct families
Families are groups of object types. This can help avoid repeating events for different object types in large projects.
Construct containers
Containers are an advanced feature for picking a group of instances at the same time in events. This is useful for building composite objects (objects made from multiple objects, such as a tank made from a base sprite and a turret sprite).
The 8 Direction behavior is blocked by any objects with the ___ behavior.
Solid
A useful feature of the Turret behavior is the ability to use
predictive aim
Construct UIDs
All objects at runtime have a unique ID assigned, which is a number starting at 0 for the first instance and incrementing by 1 for every other instance. It is returned by the object’s UID expression. This number can be used to uniquely identify a single instance throughout an entire game
Construct IIDs
All objects at runtime have an index ID assigned, which is the number of the instance within its own object type. It is returned by the object’s IID expression
ACEs term
Actions, conditions and expressions (ACE or ACEs)
npm update will only inspect top-level packages
To get the old behavior, use npm –depth 9999 update
npm-check-updates
seems awesome; install -g; ncu as alias; run ncu -u to update package.json
dir by creation time
dir /t:C
microskill: add PhantomJS
…
what does it mean when it says “index.d.ts is not a module” ?
?
the target of the new operator must be a value. Classes occupy an interesting place in the language because they are represent both a type and a value
…
find out about “export default”
…
in phantomjs index.d.ts
declare module “webpage” { export function create(): WebPage; }
import a simple .d.ts typing
import “webrtc”; you may need to use “moduleResolution”: “node” in the compiler options. Alternatively use the “types”: [“webrtc”] compiler option and the compiler will automatically load those types up for you.
install @types/phantom not @types/phantomjs?
…
the one-liner for importing a .d.ts typing
change output to ES6; and, import * as phantom from ‘phantom’;
EaW spoiler Hera
Hera can get a vehicle out Turn 1, add C3-PO, which makes C3-PO akin to say a Holocron
What is the default expiration of an ASP.NET created “new HttpCookie()” . . . ?
The default Expires value for a cookie is not a static time, but it creates a Session cookie. This will stay active until the user closes their browser/clears their cookie
difference between merge and concat
merge interleaves items; concat emits all of source observable before moving on to the next
VSC change language mode
Ctrl-K M
highlight.js
syntax highlighting for the web
expand AST select
Shift-Alt-right (Shift-Alt-left to collapse)
go to next problem/error
F8 (shift-F8 to previous)
Ctrl-\
split editor
Ctrl+Alt+Right
move Editor into Next Group (ctrl-alt-left previous)
Ctrl+1
Focus into First Editor Group
Ctrl+K Ctrl+Left
Focus into Editor Group on the Left (right)
Ctrl+Shift+PageUp
Move Editor Left (pgdn - right)
Ctrl+K Left
Move Active Editor Group Left
Ctrl+K P
Copy Path of Active File
Ctrl+K W
Close Group
Ctrl+Tab
Open Next (Shift-Ctrl-Tab = open previous)
Ctrl+K Z
Toggle Zen Mode