<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorControlNormal">#00000000</item>
<item name="android:spinnerStyle">@style/SpinnerStyle</item>
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
| // https://gist.github.com/vlucas/2bd40f62d20c1d49237a109d491974eb | |
| "use strict"; | |
| const { errorLog } = require("./logger"); | |
| const crypto = require("crypto"); | |
| const ENCRYPTION_KEY = | |
| process.env.ENCRYPTION_KEY || "Dw-3]v,#FX@1gerbSAC4Jhn2=$!q/K.Z"; // Must be 256 bits (32 characters) | |
| const IV_LENGTH = 16; // For AES, this is always 16 |
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
| export function uniqueItems(objArray, key) { | |
| if (!objArray || !key) { | |
| console.error("no args", objArray, key); | |
| return objArray; | |
| } | |
| return objArray.reduce((result, obj) => { | |
| if (result.find((o) => o[key] == obj[key])) { | |
| return result; | |
| } |
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
| getPromisifiedConnection(pool) { | |
| return util.promisify(pool.getConnection).bind(pool); | |
| } | |
| getPromisifiedBeginTransaction(connection) { | |
| return util.promisify(connection.beginTransaction.bind(connection)); | |
| } | |
| getPromisifiedQuery(connection) { | |
| util.promisify((sql, options, cb) => |
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
| void main() { | |
| // //1 | |
| // final List<dynamic> myNums = ["1", "whatever", {}]; | |
| // // final List<dynamic> myNums = const ["1","whatever",{}]; | |
| // myNums.add("lskf"); | |
| // // myNums = [...myNums,"lskf"]; | |
| // print(myNums); | |
| // //2 | |
| // List<int> nums = List(5); |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
| <title>EXIF example with inline EXIF info</title> | |
| </head> | |
| <body> | |
| <br /> |
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
| //0.60.x, enableHermes-true : replace hermesvm with hermes-engine(npm install hermes-engine) | |
| // and include this file in app folder change react.gradle path to this filepath | |
| // in app/build.gradle | |
| import org.apache.tools.ant.taskdefs.condition.Os | |
| def config = project.hasProperty("react") ? project.react : []; | |
| def cliPath = config.cliPath ?: "node_modules/react-native/cli.js" | |
| def composeSourceMapsPath = config.composeSourceMapsPath ?: "node_modules/react-native/scripts/compose-source-maps.js" | |
| def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" |
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
| const http = require("http"); | |
| const fs = require("fs"); | |
| const pathToStaticFilesFolder = "./dist";//or whererver | |
| http | |
| .createServer((req, res) => { | |
| console.log(req.url); | |
| let fileStream; | |
| //if no path or path doesnot contain a file extension |
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
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Launch Development", |
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
| //writes a billion numbers to file. size: 9.3GB | |
| let writeStream = fs.createWriteStream("./output"); | |
| writeStream.on('open',async ()=>{ | |
| while (k<=10**9){ | |
| let written = k%10 == 0 ? writeStream.write(k.toString()+"\n") : writeStream.write(k.toString()+" "); | |
| /** | |
| imp stuff..., without which out-of-memory error is thrown. | |
| [https://stackoverflow.com/a/40221132/7314900] stream.write() method returns false when stream has large enough data. so, | |
| */ | |
| if(!written){ |