This file contains 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
l1 = [1,3,9,10,4,3,2,5,17,14,11] | |
def splitIt(x): | |
''' | |
This recursive function takes a list of positive integers | |
x as argument and returns a tuple of two lists: a list of the even integers | |
in x followed by a list of the odd integers in x. | |
E.g. x = [3,2,1,5,4,6] gives [1,3,5] [2,4,6] | |
x = [1,3,9] gives [1,3,9] [] |
This file contains 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 one() {console.log('one')} // named function | |
one(); | |
new Array([0]).forEach(function() {console.log('two')}) // anonymous function | |
const three = function() {console.log('three')}; // aliased anonymous function | |
three(); | |
const container = { | |
four: function() {console.log('four')}, // aliased anonymous function |
This file contains 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
<html> | |
<style> | |
html, body { | |
margin: 0; | |
padding: 0; | |
background: #ccc; | |
font-family: sans-serif; | |
} | |
h1, #input { |
This file contains 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
enum Stats { | |
int = 'int does stuff', | |
str = 'str does other stuff', | |
def = 'def prevents stuff', | |
} | |
type StatName = keyof typeof Stats | |
interface HasStats { | |
stats: { |
This file contains 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
public void testSetWeight() | |
{ | |
float INT_TEST_PRECISION = 0; | |
// Create a client object using the constructor with 5 parameters. | |
Client tstClient = new Client("Smith", "Carl", 44, 70, 200); | |
assertNotNull(tstClient); | |
// set weight to a new value | |
tstClient.setWeight(180); |
This file contains 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
node_modules | |
package-lock.json | |
js | |
bundle.js |
This file contains 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
#!/bin/bash | |
FILE=$1 | |
if [ -f $FILE ]; then | |
curl $FILE > $FILE.new | |
cmp --silent $FILE $FILE.new || <do stuff here because the website changed> | |
else | |
curl $FILE > $file | |
fi |
This file contains 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
import { | |
AfterContentInit, Component, ContentChildren, | |
EventEmitter, Input, OnChanges, | |
OnInit, Output, TemplateRef | |
} from '@angular/core' | |
import { chunkArray } from '@trapeze-gui/common' | |
@Component({ | |
selector: 'trapeze-table', |
This file contains 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
{ | |
"stats": [ | |
{ | |
"abbr": "STR", | |
"name": "Strength", | |
"desc": "Used for base physical attack, max carry weight, etc.", | |
"also": ["END", "ATT"] | |
}, { | |
"abbr": "WIS", | |
"name": "Wisdom", |
This file contains 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
{ | |
"locations": { | |
"Lighthouse": "tp @p 2121 63 -55 0 0", | |
"Haven": "tp @p 2576 69 270 -90 0" | |
} | |
} |
NewerOlder