- Code smell (from listing, off name)
- Refactoring (official name, from listing)
- Make 4 changes
- has to be 4 separate changes
- don’t change all at once
- Same list of smells and refactoring are given
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sum(arr, i, j) { | |
return arr.slice(i, j).reduce((prev, current) => current += prev, 0); | |
} | |
console.log(sum([1, 2, 3, 4, 5], 1, 3)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \ | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>my.shim.catalina.captivenetworkassistant.plist</string> | |
<key>LowPriorityIO</key> | |
<true/> | |
<key>ProgramArguments</key> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"topic":"weather","data":[-29.85092273691336]},{"topic":"weather","data":[34.127802211757185]},{"topic":"weather","data":[39.73724969905507]},{"topic":"weather","data":[17.708340534620127]},{"topic":"weather","data":[43.671826418041306]},{"topic":"weather","data":[-8.885247606175724]},{"topic":"weather","data":[-14.288513120383419]},{"topic":"weather","data":[-14.938803769871123]},{"topic":"weather","data":[-29.553742810153057]},{"topic":"weather","data":[33.03236732854032]},{"topic":"weather","data":[20.4762743473849]},{"topic":"weather","data":[-9.955597861605064]},{"topic":"weather","data":[7.693499175468759]},{"topic":"weather","data":[18.40701151261424]},{"topic":"weather","data":[-26.311356109832218]},{"topic":"weather","data":[38.12609281914723]},{"topic":"weather","data":[12.558345064581722]},{"topic":"weather","data":[-13.631466535459243]},{"topic":"weather","data":[-19.823479889164396]},{"topic":"weather","data":[-26.420139545205586]},{"topic":"weather","data":[-22.10232779768183]},{"topic":"weath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const fs = require('fs'); | |
/** | |
* Simple script to generate random data for our mongodb | |
* example: | |
* node generate.js <topic_name> <min> <max> <numEntries> | |
* | |
* # or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity ...> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN"/> | |
<!-- | |
The line below specifies where to display the application. | |
In the regular application, the value would be "android.intent.category.MAIN" | |
--> | |
<category android:name="android.intent.category.INFO"/> | |
</intent-filter> | |
</activity> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import struct | |
pad = 'a' * 96 | |
addr = struct.pack('L', 0xreturn_addr + 50) | |
nops = '\x90' * 100 | |
shellcode = "copy it here" | |
print pad + addr + nops + shellcode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UIColor+HexString.h | |
#import <UIKit/UIColor.h> | |
NS_ASSUME_NONNULL_BEGIN | |
@interface UIColor (HexString) | |
+ (UIColor *) colorWithHexString: (NSString *) hexString; | |
+ (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!isLoaded()) { | |
var interval = setInterval(function () { | |
if (isLoaded()) { | |
clearInterval(interval); | |
loaded = true; | |
$(Event).trigger('loaded'); | |
} | |
}, 10); | |
} else { | |
loaded = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<button id="btn">show answers</button> | |
<script> | |
var btn = document.getElementById('btn'); | |
var body = document.body; | |
btn.onclick = function (event) { | |
body.insertAdjacentHtml('afterend', '<p>some paragraph</p>'); | |
}; | |
</script> | |
</body> |