Skip to content

Instantly share code, notes, and snippets.

View matthlavacka's full-sized avatar
🏠
Working from home

Matt H matthlavacka

🏠
Working from home
View GitHub Profile
<head>
<title>Yak</title>
<!-- To support mobile-devices -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
@matthlavacka
matthlavacka / vkcom_audio_download.py
Created February 21, 2016 02:56 — forked from st4lk/vkcom_audio_download.py
Python: vkontakte.ru (vk.com) audio music downloader
# -*- coding: utf-8 -*-
"""
Скрипт для скачивания музыки с сайта vkontakte.ru (vk.com)
Запуск:
python vkcom_audio_download.py
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,
то открывается страница в браузере с запросом на доступ к аккаунту.
console.log('Time now ' + new Date());
const t = new Date();
t.setSeconds(t.getSeconds() + 10);
console.log('Setting job to future in 10 seconds ' + t);
SyncedCron.add({
name: 'aggregateNotifications',
schedule: function (parser) {
// Every 12 hours
return parser.text('every 12 hours');
import { Posts } from '../../api/posts/posts.js';
import { Villages } from '../../api/villages/villages.js';
import { Notifications } from '../../api/notifications/notifications.js';
import { Comments } from '../../api/comments/comments.js';
import { Inbox } from '../../api/inbox/inbox.js';
import { Emails } from '../../api/emails/emails.js';
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
@matthlavacka
matthlavacka / vehicle-json.json
Last active September 7, 2016 19:34
Vehicle List
// New
[
{"brand": "Seat", "models": ["Alhambra", "Altea", "Altea XL", "Arosa", "Cordoba", "Cordoba Vario", "Exeo", "Ibiza", "Ibiza ST", "Exeo ST", "Leon", "Leon ST", "Inca", "Mii", "Toledo"]},
{"brand": "Renault", "models": ["Captur", "Clio", "Clio Grandtour", "Espace", "Express", "Fluence", "Grand Espace", "Grand Modus", "Grand Scenic", "Kadjar", "Kangoo", "Kangoo Express", "Koleos", "Laguna", "Laguna Grandtour", "Latitude", "Mascott", "Mégane", "Mégane CC", "Mégane Combi", "Mégane Grandtour", "Mégane Coupé", "Mégane Grandtour", "Mégane Coupé", "Mégane Scénic", "Scénic", "Talisman", "Talisman Grandtour", "Thalia", "Twingo", "Wind"]},
]
// Old
(1998, ’Seat’, ‘Altea’),
(1998, ’Seat’, ‘Altea XL’),
(1998, ’Seat’, ‘Arosa’),
@matthlavacka
matthlavacka / gist:430a0d18caccc1a61dd55d2c53928794
Last active September 29, 2016 09:39 — forked from guilhermef/gist:297680f457f82fb27b3d
Install Thumbor 5.2.1 on Ubuntu 15.04
# sudo su and run the following
sudo aptitude update
# install all dependencies
sudo aptitude -y install \
python-pip \
python2.7-dev \
libssl-dev \
libcurl4-openssl-dev \
@matthlavacka
matthlavacka / fix.sh
Last active October 19, 2016 09:33
Script to fix dyld error
# It looks like the distributed versions of Node and npm live here:
~/.meteor/packages/meteor-tool/1.3.5.1/mt-os.osx.x86_64/dev_bundle/bin/
# To make sure that the executables there are found before any systemwide installed executables,
# you can add them to your $PATH variable like this:
export PATH=~/.meteor/packages/meteor-tool/1.3.5.1/mt-os.osx.x86_64/dev_bundle/bin/:$PATH
# After running the line above, try and see what these say:
which node
which npm
@matthlavacka
matthlavacka / first-request-per-month-per-user-type.js
Created December 22, 2016 10:39
Count first time Requests per month per user type
const date1 = new Date("November 1, 2016 00:00:01");
const date2 = new Date("November 30, 2016 23:59:59");
db.requests.aggregate([
{
$match: {
status: 'finished',
booker: {$exists: true},
}
},
function () {
this.plugin("done", function (stats) {
var replaceInFile = function (filePath, toReplace, replacement) {
var replacer = function (match) {
console.log('Replacing in %s: %s => %s', filePath, match, replacement);
return replacement
};
var str = fs.readFileSync(filePath, 'utf8');
var out = str.replace(new RegExp(toReplace, 'g'), replacer);
fs.writeFileSync(filePath, out);
@matthlavacka
matthlavacka / MongoDB_macOS_Sierra.md
Created May 17, 2017 09:17 — forked from nrollr/MongoDB_macOS_Sierra.md
Install MongoDB on Sierra using Homebrew

##Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"