Skip to content

Instantly share code, notes, and snippets.

Charles Bochet charlesBochet

  • LuckeyHomes
  • Paris
Block or report user

Report or block charlesBochet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View print.js
var page = new WebPage();
page.paperSize = {
format: "A4",
orientation: "portrait",
margin: {left: "1cm", right: "1cm", top: "1cm", bottom: "1cm"}
};
page.viewportSize = {
width: 1920,
View webpack.prod.conf.js
var webpackConfig = merge(baseWebpackConfig, {
...
plugins: [
...
// service worker caching
new SWPrecacheWebpackPlugin({
cacheId: 'my-vue-app',
filename: 'service-worker.js',
staticFileGlobs: ['dist/**/*.{js,html,css}'],
minify: true,
View webpack.prod.conf.js
var SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin')
...
var webpackConfig = merge(baseWebpackConfig, {
...
plugins: [
...
// service worker caching
new SWPrecacheWebpackPlugin({
View service-worker.js
"use strict";
function setOfCachedUrls(e) {
return e.keys().then(function (e) {
return e.map(function (e) {
return e.url
})
}).then(function (e) {
return new Set(e)
})
}
View service-worker.js
"use strict";
var precacheConfig = [
["index.html", "218187414cc275eaa7bb37f098e0fc92"],
["static/css/app.d1a62a5e00430713ca6ccd67cb5fd580.css", "d1a62a5e00430713ca6ccd67cb5fd580"],
["static/js/app.04ef0c51d385926ea560.js", "13cfbbcfd7077380247bbbb6d9731463"],
["static/js/manifest.2d92f59992387f01763b.js", "00451931f39fbee842952a5d349f22a6"],
["static/js/vendor.0140506021c3a9c89dd2.js", "27f61c490b1b8af1d621b16afdd174bb"]
];
...
View webpack.prod.conf.js
var SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin')
...
var webpackConfig = merge(baseWebpackConfig, {
...
plugins: [
...
// service worker caching
new SWPrecacheWebpackPlugin({
View webpack.prod.conf.js
runtimeCaching: [
{
urlPattern: /^https:\/\/thecatapi\.com\/api\/images\/get\.php\?id/,
handler: 'cacheFirst'
},
{
urlPattern: /^https:\/\/(\d+)\.media\.tumblr\.com\//,
handler: 'cacheFirst'
},
{
View HomeView.vue
<script>
export default {
methods: {
displayDetails (id) {
this.$router.push({name: 'detail', params: { id: id }})
},
getCats () {
if (navigator.onLine) {
this.saveCatsToCache()
return this.$root.cat
View aggregate.py
{
'$match': {
'$and': [
{'timestamp': {'$gte': start_date, '$lt': end_date}},
{'recipients': {'$nin': [None]}},
]
}
}
View aggregate-project.py
{
'$project': {
'quarterStart': {
'$subtract': [
'$timestamp',
{
'$add': [
{
'$multiply': [
{
You can’t perform that action at this time.