Skip to content

Instantly share code, notes, and snippets.

@alexanderblackh
alexanderblackh / react_native_setup.sh
Last active April 2, 2024 01:18
React Native Setup (custom structure)
#!/bin/bash
Blue='\033[0;34m' # Blue
Green='\033[0;32m' # Green
Red='\033[0;31m' # Red
Color_Off='\033[0m' # Text Reset
# Function to validate project name
validate_project_name() {
local project_name="$1"
if [[ "$project_name" =~ [^a-z] ]]; then
echo -e "\n${Red}Error: Project name must contain only lowercase letters. Exiting..."
db.entries
.aggregate([
{$match: {'context.plugin': 'twitter', 'context.action': 'getTimeline', 'data.text._processed.language_tone.confidence': {$not: {$type: 10}}}},
{$addFields: {twitter_username: { "$ifNull": [ "$data.user.screen_name._raw", "$data.screen_name._raw" ] } }},
{$group: {_id: '$twitter_username',language_tones: {$push: '$data.text._processed.language_tone' }}},
{$unwind: '$language_tones'},
{$unwind: '$language_tones'},
{$group: {_id: '$_id', scores: {$push: '$language_tones'}}},
{$project: {_id: 1,
//The double $$ is what's causing the issues
{
"mappings": {
"_default_": {
"properties": {
"@timestamp": {"type": "date", "format": "epoch_millis"}
},
"dynamic_templates": [
{
"strings": {
"match_mapping_type": "string",