brew uninstall --ignore-dependencies node icu4c
brew install node
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
Redis::connection()->del('queues:myqueue'); |
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
<?php | |
// Converts a number into a short version, eg: 1000 -> 1k | |
// Based on: http://stackoverflow.com/a/4371114 | |
function number_format_short( $n, $precision = 1 ) { | |
if ($n < 900) { | |
// 0 - 900 | |
$n_format = number_format($n, $precision); | |
$suffix = ''; | |
} else if ($n < 900000) { |
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
#!/usr/bin/env bash | |
# This script prints out all of your Redis keys and their size in a human readable format | |
# Copyright 2013 Brent O'Connor | |
# License: http://www.apache.org/licenses/LICENSE-2.0 | |
human_size() { | |
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } ' | |
} |
A handful of BigQuery SQL queries that you can use to analyze your own Google Analytics for Firebase data. To find out more about how they work, check out our presentation from Cloud Next 2018 (Video link to be added soon)
Please note that these scripts have been updated to make sure of the new Firebase schema, which was rolled out to Analytics products in July of 2018.
Note that none of these scripts will work out of the box -- you'll need to update the values in brackets with the names of your actual datasets, and you'll most likely also need to replace the names of events and event properties with ones that are appropriate for your app.
The contents of this gist are licensed under the Apache License, version 2.0
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
<?php | |
function evenSum($n) { | |
return ($n * ($n + 1)); | |
} | |
$n = 20; | |
echo "Sum of first: ". $n." even numbers is: " . evenSum($n); | |
?> |
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
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Excel To Array | |
|-------------------------------------------------------------------------- | |
| Helper function to convert excel sheet to key value array | |
| Input: path to excel file, set wether excel first row are headers | |
| Dependencies: PHPExcel.php include needed | |
*/ | |
function excelToArray($filePath, $header=true){ |
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
#include <stdio.h> | |
int main() | |
{ | |
int fNum, sNum, tNum, gNum; | |
printf("Enter three integer numbers: "); | |
scanf("%d %d %d", & fNum, & sNum, & tNum); | |
gNum = fNum>sNum?(fNum>tNum?fNum:tNum):(sNum>tNum?sNum:tNum); | |
printf("%d is the greatest number.", gNum); | |
return 0; | |
} |
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 | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
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
<?php | |
/* vars for export */ | |
// database record to be exported | |
$db_record = 'XXXXXXXXX'; | |
// optional where query | |
$where = 'WHERE 1 ORDER BY 1'; | |
// filename for export | |
$csv_filename = 'db_export_'.$db_record.'_'.date('Y-m-d').'.csv'; | |
// database variables |