Skip to content

Instantly share code, notes, and snippets.

@JamieCurnow
JamieCurnow / firestore.ts
Created December 8, 2020 13:33
Using Firestore with Typescript - no examples
/**
* This Gist is part of a medium article - read here:
* https://jamiecurnow.medium.com/using-firestore-with-typescript-65bd2a602945
*/
// import firstore (obviously)
import { firestore } from "firebase-admin"
// Import or define your types
// import { YourType } from '~/@types'
name: Firestore Backups
on:
workflow_dispatch:
inputs:
name:
description: 'Backup'
default: 'Backup'
required: false
schedule:
- cron: '0 0 1-31/2 * *'
@roalcantara
roalcantara / cloud_firestore_security_rules_helper_functions.rules
Created March 9, 2018 01:46
Cloud Firestore Security Rules Helper Functions
service cloud.firestore {
match /databases/{database}/documents {
// USERS //
function isAuthenticated() {
return request.auth != null;
}
function userExists(uid) {
@shantanubhadoria
shantanubhadoria / config.js
Last active December 7, 2015 20:03
Angular Meteor: Using the pageTitle field inside data from angular-ui-router state params to modify html title tag
angular.module('module-name')
.config(function($stateProvider) {
$stateProvider
.state('base.location',{
url: '/location',
templateUrl: 'client/location/location.ng.html',
// This is supposed to update page title when state changes(works in angularjs but doesnt work in angular-meteor)
data: {
'pageTitle': 'Locations'
/**
* Each view are defined as state.
* Initial there are written state for all view in theme.
*/
function config($stateProvider, $urlRouterProvider, $ocLazyLoadProvider, IdleProvider, KeepaliveProvider) {
// Configure Idle settings
IdleProvider.idle(5); // in seconds
IdleProvider.timeout(120); // in seconds
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active April 14, 2025 11:07
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh