Skip to content

Instantly share code, notes, and snippets.

View distalx's full-sized avatar

distalx

  • Remote, Global
View GitHub Profile
@distalx
distalx / animate.html
Created March 8, 2021 04:37 — forked from coagmano/animate.html
Blaze animate HOC
{{> UI.ContentBlock }}
@distalx
distalx / client.js
Created January 22, 2020 12:37 — forked from filipenevola/client.js
Meteor Apollo snippets
/**
Snippets showing how to configure Apollo with Meteor in two different ways:
1 - Using DDP (websocket connection)
2 - Using HTTP (post requests)
I'm using a regular HTTP post approach when isAPIModule() returns true
and DDP approach when returns false. I control isAPIModule changing
a setting in the deployment settings.json
That is not necessary for almost every application but in my case I have
@distalx
distalx / call_modal_client.js
Created July 19, 2019 02:27 — forked from dperetti/call_modal_client.js
Meteor Handlebars modal pattern
Session.set('modalData', {template: "modal-backups", title: "Backup", files: [{name: "blah", date: new Date()}]});
$('#myModal').modal();
@distalx
distalx / timezones.js
Created July 11, 2019 22:35
All timezones
export const timezones = [
{
id: 1,
label_text: '(GMT-12:00) International Date Line West',
muted_text: '',
daylight_saving: 0,
value: '-12',
active: true,
},
{
@distalx
distalx / .eslintrc.js
Created February 16, 2019 08:45
linting configuration.
/**
* Clozer's Javascript linting configuration
*
* Documentation on rules can be found at:
* http://eslint.org/docs/rules/ <- Optionally append the rule name
*/
{
'parser': 'babel-eslint',
'parserOptions': {
'allowImportExportEverywhere': true
@distalx
distalx / main.js
Created February 16, 2019 08:42
Meteor + express
//server/main.js
import { Meteor } from 'meteor/meteor';
import express from 'express';
const app = express();
app.get('/api', (req, res) => {
res.status(200).json({ message: 'Hello World!!!'});
});
@distalx
distalx / git-pull-all.sh
Created January 23, 2019 14:34
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | grep -v 'master' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
@distalx
distalx / nginx_log_parsing.md
Last active June 16, 2018 19:27
collection of one-liner for parsing nginx log files source : https://easyengine.io/tutorials/nginx/log-parsing/

Sort access by Response Codes

cat access.log | cut -d '"' -f3 | cut -d ' ' -f2 | sort | uniq -c | sort -rn
awk '{print $9}' access.log | sort | uniq -c | sort -rn
@distalx
distalx / migration.js
Created March 3, 2017 16:30
CollectionFS to Meteor-Files
import fs from 'fs';
import Grid from 'gridfs-stream';
import { MongoInternals } from 'meteor/mongo';
//collections
import { Images } from '/imports/api/collections/Images/Images.js';
import { ImagesV2 } from '/imports/api/collections/Images/ImagesV2.js';
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶