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 class Volatility { | |
static int NEXT_IN_LINE = 0; | |
public static void main(String[] args) throws Exception { | |
new CustomerInLine().start(); | |
new Queue().start(); | |
} | |
static class CustomerInLine extends Thread { |
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
// Engine.java | |
public interface Engine { | |
void start(); | |
void stop(); | |
} |
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
/* | |
REQUIREMENTS: | |
--------- | |
1) JQuery is required | |
2) Create a element with the id of "console-log" | |
EX: <div id="console-log"></div> | |
USAGE: | |
--------- | |
console.log('hello'); |
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
// String, need to escape backslashes | |
def bs = '\\\\' | |
// Slashy Strings: /abc/ | |
// String literal not needing additional backslashes to escape special characters. | |
def path = /C:\dev\source/ | |
// G-Strings (double-quotes) |
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
// Run the BootStrap.groovy script within the Grails Console | |
// http://derekmarley.com/2010/10/27/grails-bootstrap-within-the-grails-console/ | |
new BootStrap().init(ctx.servletContext) | |
// Create toString method | |
// http://groovy.codehaus.org/gapi/groovy/transform/ToString.html | |
@ToString // Annotate class | |
foo.toString() // usage |
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
javascript:(function(){ alert('it worked'); })(); |
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
// EC-3248: POST => spots/v1/ | |
public createSpot(spot: Spot): Observable<string> { | |
const formData: FormData = new FormData(); | |
_.map(spot.filesToUpload, (toUpload: FileToUpload) => formData.append('files', toUpload.file, toUpload.file.name)); | |
formData.append('spot', JSON.stringify(spot)); | |
return this.http.post<string>(`${this._apiRoot}/spots/v1`, formData, { observe: "response"}) | |
.pipe( | |
tap(resp => { console.log(resp.headers); }), | |
map(resp => { | |
const keys = resp.headers.keys(); |
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
// ------------- component (template) ---------------- | |
<v-chip id='example-chip' v-show="showChip">Example Chip</v-chip> | |
<v-btn color="info" @click="showChip = true">Click Me</v-btn> | |
// ------------- component (data) ---------------- | |
data: () => ({ | |
showChip: false, | |
name: "mike" |
- combineAll
- combineLatest
- concat - Subscribe to Observables in order as previous completes, emit values. (The next transaction (subscription) cannot start until the previous completes!)
- concatAll
- forkJoin
- merge - Turn multiple Observables into a single observable.
- mergeAll - Collect and subscribe to all observables.
- race
- startsWith
OlderNewer