Skip to content

Instantly share code, notes, and snippets.

@veeramarni
veeramarni / index.html
Created January 18, 2021 16:46 — forked from mjbvz/index.html
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<script>
require('./renderer.js')
@veeramarni
veeramarni / Jenkinsfile
Created January 4, 2020 23:58 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@veeramarni
veeramarni / meteor-async.md
Created January 4, 2016 16:42 — forked from possibilities/meteor-async.md
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

@veeramarni
veeramarni / devert
Created December 22, 2015 10:39 — forked from cfr/devert
Fix vertical video
#!/usr/bin/env sh
# http://stackoverflow.com/a/30819570/187663
ffmpeg -i $1 -i $1 -filter_complex "[0:v]scale=-1:720[scaled_video];[1:v]scale=1280:720,boxblur=16[blur_image];[blur_image][scaled_video]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2[outv]" -c:v libx264 -aspect 1280/720 -map [outv] -map 0:a -c:a copy $1.fixed.mp4
@veeramarni
veeramarni / async.js
Created December 11, 2015 22:47 — forked from cmather/async.js
Async call from within a Meteor server side method.
if (Meteor.isServer) {
var Fiber = Npm.require('fibers');
function async (cb) {
Meteor.setTimeout(function () {
cb(null, 'hello');
}, 3000);
}
Meteor.methods({
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# (C)2010 Owen Carter @ Mirabeau BV
# This script is provided as-is; no liability can be accepted for use.
# You are free to modify and reproduce so long as this attribution is preserved.
#
# (C)2013 Benoît LELEVÉ @ Exsellium (www.exsellium.com)
# Adding parameters in order to execute the script in a multiple MySQL instances environment
#!/bin/sh
TMPFILE="/tmp/innobackupex-runner.$$.tmp"
USEROPTIONS="--user=XXX --password=XXX"
FILTERTABLES="--include=.*[.].*"
BACKDIR=/var/mysql-bak
BASEBACKDIR=$BACKDIR/base
INCRBACKDIR=$BACKDIR/incr
FULLBACKUPLIFE=3600 #604800 # How long to keep incrementing a backup for, minimum 60
KEEP=1 # Keep this number of backups, appart form the one currently being incremented