Skip to content

Instantly share code, notes, and snippets.

@yevrah
yevrah / amazon_sender.py
Created July 15, 2019 06:49 — forked from amix/amazon_sender.py
Amazon SES helper script using boto
# -*- coding: utf-8 -*-
"""
amazon_sender.py
~~~~~~~~
Python helper class that can send emails using Amazon SES and boto.
The biggest feature of this class is that encodings are handled properly.
It can send both text and html emails.
This implementation is using Python's standard library (which opens up for a lot more options).
@yevrah
yevrah / nodejs-cheatsheet.js
Created March 14, 2019 05:52 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@yevrah
yevrah / flask.py
Created July 6, 2018 00:45
Flask: Annotated Boilerplate.
# A very simple Flask Hello World app for you to get started with...
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello from Flask!'
@yevrah
yevrah / Upgrade vim
Last active September 25, 2023 05:11
Update to Vim8 on Centos 7
################################################################################
# Method 1: Install using rpm packages (credit to DarkMukke)
#
rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
# WARNING: removing vim-minimal uninstalls `sudo` if you skip the second step
# make sure to at least run `yum install sudo`
yum -y remove vim-minimal vim-common vim-enhanced
@yevrah
yevrah / Upgrade vim
Created February 7, 2018 22:10
Update to Vim8 on Centos 7
# You may use this CentOS 7 repository on Fedora Copr for Vim 8 builds.
# https://copr.fedorainfracloud.org/coprs/mcepl/vim8/
#
# Run these commands on CentOS 7.
# Add this repository:
sudo curl -L https://copr.fedorainfracloud.org/coprs/mcepl/vim8/repo/epel-7/mcepl-vim8-epel-7.repo -o /etc/yum.repos.d/mcepl-vim8-epel-7.repo
# Upgrade Vim to vim 8:
@yevrah
yevrah / romanize.py
Last active October 13, 2017 04:40
Roman Numerals
#!/usr/bin/env python3
# encoding: utf-8
class Romanize():
# Values from https://www.math.nmsu.edu/~pmorandi/math111f01/RomanNumerals.html
numbers = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
numeral = [ 'm', 'cm', 'd', 'cd', 'c', 'xc', 'l', 'xl', 'x', 'ix', 'v', 'iv', 'i']
def calculate(number):
out = ""
@yevrah
yevrah / crud_template.pl
Created September 5, 2017 23:25
Perl: App.pm Example
#!/usr/bin/env perl
# Sane defaults
require 5.004;
use strict 'vars';
use warnings;
use diagnostics;
use CGI::Carp qw(fatalsToBrowser);
# Stadard libaries
@yevrah
yevrah / crud_template.pl
Created September 5, 2017 23:25
Perl: App.pm Example
#!/usr/bin/env perl
# Sane defaults
require 5.004;
use strict 'vars';
use warnings;
use diagnostics;
use CGI::Carp qw(fatalsToBrowser);
# Stadard libaries
@yevrah
yevrah / data_sections.pl
Created July 7, 2017 05:26
PERL: Multiple data sections
#!/usr/bin/env perl
# Sane defaults
use strict;
use warnings;
use feature qw/say/;
use Data::Dumper;
my @data = <DATA>;
@yevrah
yevrah / integration.js
Created August 18, 2016 00:57
JAVSCRIPT: Angular and Phaser Integration
// Namespace declarations
var wingaru = wingaru || {};
var wingaru.auth = wingaru.auth || {};
var wingaru.games = wingaru.games || {};
var wingaru.activites = wingaru.acivities || {};
var wingaru.videos = wingaru.videos || {};
//
// Generic Helper
//