Skip to content

Instantly share code, notes, and snippets.

View jxc876's full-sized avatar
:octocat:

Michael Ramirez jxc876

:octocat:
  • Texas, United States
View GitHub Profile
@jxc876
jxc876 / readme.md
Last active July 25, 2019 21:16
Set Approval Request User

Usage 1 - triggered by publish button

<button(click)="publish()"...>
  {{ smartRotation.approvalRequestUser | smartRotationPublishText }}
</button>
  public publish(): void {

Combination

  • 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
// ------------- 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"
@jxc876
jxc876 / service.ts
Created October 16, 2018 02:52
get headers
// 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();
@jxc876
jxc876 / login.js
Last active February 29, 2016 22:35
javascript:(function(){ alert('it worked'); })();
@jxc876
jxc876 / gist:7a4de0023f8fa63fdf2e
Created February 11, 2015 17:19
Grails cheatsheet
// 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
@jxc876
jxc876 / gist:9728dae3065a102cca0e
Last active August 29, 2015 14:13
Groovy Regex
// 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)
@jxc876
jxc876 / jsfiddle-logging
Last active August 29, 2015 14:13
Log on
/*
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');