Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sr9yar on github.
  • I am sr9yar (https://keybase.io/sr9yar) on keybase.
  • I have a public key ASBDwStsY3cFBvc4vGB0iMGHrciiN2-kJG9ll3mjlQeIlAo

To claim this, I am signing this object:

@sr9yar
sr9yar / iam-policy.json
Last active June 17, 2020 09:44 — forked from woganmay/iam-policy.json
IAM policy to grant a user narrow access to one S3 bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
@sr9yar
sr9yar / WritingMagentoModules.md
Last active October 31, 2018 16:54 — forked from leek/WritingMagentoModules.md
Writing Modules for Magento 1.x

Writing Magento Modules

All custom modules should have a Namespace and Module Name. These are used below as {Namespace} and {Module}.

Caution: The Magento autoloader is known to have problems with CamelCase namespaces and/or modules between Windows and *nix systems. If your module requires more than one word for either of these, it is best to just concatenate them to avoid any issues (Example: {Namespace}_{Examplemodule}).

Index

@sr9yar
sr9yar / Dockerfile
Created November 22, 2018 10:01
Docker container with Blender and python 3
FROM ubuntu:bionic
RUN \
apt-get update && \
apt-get -y upgrade && \
apt-get install -y python3 python3-pip python3-dev python3-setuptools ca-certificates nano
RUN \
cp /usr/bin/python3.6 /usr/bin/python && \
cp /usr/bin/pip3 /usr/bin/pip
@sr9yar
sr9yar / setup-linux-pool.sh
Created December 4, 2018 17:19
Blender 2.79 install for Azure Render VM
#!/bin/bash
echo '# Running apt-get update ...'
apt-get update
echo '# Installing imagemagick ...'
apt-get install -y imagemagick
echo '# Installing blender ...'
apt-get install -y software-properties-common
add-apt-repository -y ppa:thomas-schiex/blender
apt-get install -y blender
echo '# Installing python-pip ...'
#!/bin/bash
# Saves the last frame of
# mp4/h264 matroska as png
# with ffmpeg
input_fn='output.mp4'
image_fn='output.png'
@sr9yar
sr9yar / responsive-youtube-video.html
Created June 9, 2019 11:18
Responsive youtube video
<style>
.video-wrapper
{
position: relative;
padding-bottom: 51.5%;
padding-top: 25px;
height: 0;
border-radius: 4px;
overflow: hidden;
@sr9yar
sr9yar / browser-window-resize-event-listener.js
Created June 9, 2019 12:38
Browser window resize event listener
function handleResize() {
const heights = {};
heights.window = window.innerHeight;
const [contactsTable] = document.getElementsByClassName('contacts-table');
if (contactsTable) {
'use strict';
// Example Usage:
// const logger: any = require("./logger.js");
// const app = new Koa();
// app.use(logger());
const chalk = require('chalk');
const winston = require("winston");
.mb-0 {
margin-bottom: 0!important;
}
.mb-1 {
margin-bottom: .25rem!important;
}
.mb-2 {
margin-bottom: .5rem!important;
}
.mb-3 {