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
require 'daemons' | |
# This file will contain all System calls by the program. | |
# (ie : Launching a programm, monitoring it) | |
# Returns the pid of the child that executes the cmd | |
module Monitor | |
module System | |
extend self | |
def daemonize(cmd, options = {}) |
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
def get_load_average | |
load_avg = nil | |
File.open('/proc/loadavg') {|f| | |
load_avg = Float(f.readline.split(' ')[2]) | |
} | |
load_avg | |
end | |
def get_ram_usage | |
mem_total = mem_free = mem_cached = nil; |
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 { firebase } from '@react-native-firebase/analytics'; | |
export default { | |
logEvent: ( | |
name: string, | |
params?: { [key: string]: any }, | |
): Promise<void> => firebase.analytics().logEvent(name, params), | |
}; |
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 { useEffect, useState } from "react"; | |
import { AnySQLiteTable, getTableConfig } from "drizzle-orm/sqlite-core"; | |
import { addDatabaseChangeListener } from "expo-sqlite/next"; | |
import { SQLiteSyncRelationalQuery } from "drizzle-orm/sqlite-core/query-builders/query"; | |
/** | |
* A helper hook that rerenders the component when the result of a query changes | |
* @param query the query to run | |
* @param dependencies the tables that the query depends on | |
* @param rowId the row id to watch for changes |