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
### Step-by-Step Full Implementation | |
#### 1. Install `react-native-config` | |
First, install the `react-native-config` package: | |
```bash | |
npm install react-native-config | |
npx react-native link react-native-config | |
``` |
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
//npm install aws-sdk aws-sdk-mock --save-dev | |
/* | |
if (process.env.NODE_ENV === 'development') { | |
require('./mockDynamoDB'); | |
} | |
*/ | |
/* | |
4. Running Your Server |
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
**message:** If I have a CSV file one record per line how can I get an md5 of the columns, title, ref, description, url | |
**message:** You can use a programming language like Python to read the CSV file, extract the values of the columns title, ref, description, and url for each record, concatenate them into a single string, and then calculate the MD5 hash of the string.Here is some sample Python code that demonstrates how to do this using the built-in csv and hashlib modules:pythonCopy codeimport csv | |
import hashlib | |
filename = "example.csv" # replace with the name of your CSV file | |
with open(filename, "r") as csvfile: | |
reader = csv.DictReader(csvfile) | |
for row in reader: |
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 | |
# Check if Heroku CLI is installed | |
if ! command -v heroku &> /dev/null; then | |
echo "Heroku CLI is not installed, please install it before running this script" | |
exit 1 | |
fi | |
# Check if user is logged in | |
if ! heroku auth:whoami &> /dev/null; then |
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
print("hello world") |
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
// utility fns | |
var getUid = function(length) { | |
var i, uid, min, max; | |
length = length || 32; | |
uid = ''; | |
min = 0; | |
max = getUid.codes.length - 1; | |
for (i = 0; i < length; i++) { |
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
/* | |
Applications filter -> Map -> Reduce and how it relates to functional | |
(Not a functional programming talk) | |
But a lil functional code | |
*/ | |
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
var express = require('express'); | |
var app = express(); | |
app.use(express.bodyParser()); | |
app.get('/:model', function (req, res) { | |
res.json(data[req.params.model]); | |
}); | |
app.get('/:model/:id', function (req, res){ | |
var record = data[req.params.model].filter(function (entry) { |
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
Object.defineProperties = function(O, Properties) { | |
// 1. If Type(O) is not Object throw a TypeError exception. | |
if (typeof(O) !== "object" || O == null) { | |
throw TypeError("Object.defineProperties called on non-object"); | |
} | |
// 2. Let props be ToObject(Properties) | |
var props = Object(Properties); // not *exactly* the same, but similar enough | |
// 3. Let names be an internal list containing the names of each enumerable own property of props. |
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
# Example CustomEvent | |
class Dispatcher | |
include CustomEventSupport | |
include BubblingSupport | |
def set_property(value) | |
dispatch 'property_change', {:value => value} | |
end | |
end |
NewerOlder