- Use HTML tags to define the table to get the best layout result
- Use either backticks (```) or the HTML
pre
element with attributelang
- Keep a blank line before and after a code block for correct formatting and syntax highlighting
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
console.log("🏃 appStoreConnectAPIFromNode.js running 🏃") | |
const fs = require('fs'); | |
const jwt = require('jsonwebtoken'); // npm i jsonwebtoken | |
// You get privateKey, apiKeyId and issuerId from your Apple App Store Connect account | |
const privateKey = fs.readFileSync("./AuthKey_123456789Z.p8") // this is the file you can only download once and should treat like a real, very precious key. | |
const apiKeyId = "123456789Z" | |
const issuerId = "12345678-CLAP-FORR-THIS-GIBBERISHLOLz" | |
let now = Math.round((new Date()).getTime() / 1000); // Notice the /1000 | |
let nowPlus20 = now + 1199 // 1200 === 20 minutes |
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
// Mock BLE so you can run example from nodejs | |
const ble = { | |
write: function(device_id, service, characteristic, buffer, success, failure) { | |
// log to console instead of writing | |
console.log('>>', new Uint8Array(buffer)); | |
// always call success callback | |
success(); | |
} | |
} |
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 {Injectable} from "@angular/core"; | |
import {Platform} from "ionic-angular"; | |
const DB_NAME: string = '__mydbname'; | |
const win: any = window; | |
@Injectable() | |
export class Sql { | |
private _dbPromise: Promise<any>; |
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 {Sql} from "../providers/Sql"; | |
export class ExamplePage { | |
constructor(private sql: Sql) { | |
//sql.query(...); | |
//... | |
} | |
} |
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
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache | |
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache | |
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
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
/** | |
* ionRadioFix - fixes a bug in iOS 9 UIWebView that breaks the tilde selector in CSS. To | |
* use this fix, include it after your Ionic bundle JS. | |
* | |
* Note: due to Angular directive override limitations, you'll need to change any reference | |
* to <ion-radio> to <ion-radio-fix> to apply this patched radio button. | |
* | |
* Also, make sure to add the new CSS from the second part of this gist. | |
*/ | |
angular.module('ionic').directive('ionRadioFix', 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
/** | |
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ================== | |
* | |
* This patch works around iOS9 UIWebView regression that causes infinite digest | |
* errors in Angular. | |
* | |
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular | |
* have the workaround baked in. | |
* | |
* To apply this patch load/bundle this file with your application and add a |
NewerOlder