md-table custom element Attributes : -headers : Array of objects which include "name" and "field" keys for table columns. -content : Array of object which is the content of table rows. -sortable : StringArray with name of sortable columns. -filters : String which filters rows in table (here a ng-model is used). -customClass : Object with columns names as keys and class names as values. -thumb : String equals to the thumbs column name.
#Ionic Publish Android App
This is the process to publish an ionic android app.
-
Make sure you set/increment the version number in
config.xml
ie0.0.3
. -
Make sure the android platform has been added
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 buffer = require('buffer'); | |
var path = require('path'); | |
var fs = require('fs'); | |
function encode_base64(filename){ | |
fs.readFile(path.join(__dirname,'/public/',filename),function(error,data){ | |
if(error){ | |
throw error; | |
}else{ | |
var buf = Buffer.from(data); |
When using the alpine docker image, the command locale -a
or locale-gen
does not exist. You might need them to install different locales in your docker image to allow your applications to support multilingual. Most common issue is when dealing with database inputs (MySQL), whereby the text will be displayed as garbage characters if you do not have the right locale installed.
FROM alpine:3.6
# ---not shown here---
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
const express = require('express'); | |
const forum = express(); | |
forum | |
.get('/healthz', (req, res, next) => { | |
res.send({ name: 'forum', status: 'healthy' }); | |
next(); | |
}) | |
.get('/d/:id', (req, res, next) => { |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
/* | |
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command: | |
ssh -R 8080:127.0.0.1:8080 operatore@146.148.22.123 | |
which opens a tunnel between the two endpoints and permit to exchange information on this direction: | |
server:8080 -----> client:8080 |
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
//Prompt users to update app if there is a new version available | |
//Uses url_launcher package | |
import 'package:url_launcher/url_launcher.dart'; | |
const APP_STORE_URL = | |
'https://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftwareUpdate?id=YOUR-APP-ID&mt=8'; | |
const PLAY_STORE_URL = | |
'https://play.google.com/store/apps/details?id=YOUR-APP-ID'; |
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
//http://www.hacksparrow.com/base64-encoding-decoding-in-node-js.html | |
var fs = require('fs'); | |
// function to encode file data to base64 encoded string | |
function base64_encode(file) { | |
// read binary data | |
var bitmap = fs.readFileSync(file); | |
// convert binary data to base64 encoded string | |
return new Buffer(bitmap).toString('base64'); | |
} |
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
const crypto = require('crypto'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const zlib = require('zlib'); | |
const AppendInitVect = require('./appendInitVect'); | |
const getCipherKey = require('./getCipherKey'); | |
function encrypt({ file, password }) { | |
// Generate a secure, pseudo random initialization vector. |
OlderNewer