Skip to content

Instantly share code, notes, and snippets.

@malikperang
malikperang / meteor.cheatsheet.coffee
Created August 14, 2016 11:01 — forked from LeCoupa/meteor.cheatsheet.coffee
Meteor Cheatsheet: Meteor Core, Publish and Subscribe, Method, Server Connections, Collections, Session, Accounts, Passwords, Templates, Match, Timers, Deps, EJSON, HTTP, Email, Assets, Command Line. More: http://journal.gentlenode.com/meteor-5-cheatsheet/
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@malikperang
malikperang / angularjs.es6.filter.js
Created May 8, 2017 06:26 — forked from anein/angularjs.es6.filter.js
Creating an angularjs filter using ES6
class MyFilter {
static filter( value ){
return value.toLowerCase();
}
}
export default MyFilter.filter;
@malikperang
malikperang / docker-gc
Created September 23, 2017 20:58 — forked from osiyuk/docker-gc
free up disk space after docker garbage
#!/bin/bash
GARBAGE="/var/lib/docker/aufs/diff"
du -hd 1 $GARBAGE | sort -hrk 1 | head -25
find $GARBAGE -maxdepth 1 -name *-removing -exec rm -rf '{}' \;
@malikperang
malikperang / install-comodo-ssl-cert-for-nginx.rst
Created November 1, 2017 08:47 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@malikperang
malikperang / extend-subscription-lengths.php
Created March 30, 2018 19:31 — forked from thenbrent/extend-subscription-lengths.php
Add a new billing range to WooCommerce Subscriptions to allow for longer subscription lengths. Specifically a new "36 months" range to allow you to sell a subscription with a length of 36 months.Requires Subscriptions 1.4.4 or newer.
<?php
/**
* Plugin Name: WooCommerce Subscription Length Extender
* Description: Add a custom 36 month subscription length to WooCommerce Subscriptions (requires WC Subscriptions 1.4.4 or newer) to give the option of having a subscription expire after 36 months.
* Author: Brent Shepherd
* Version: 1.0
* License: GPL v2
*/
function eg_extend_subscription_expiration_options( $subscription_lengths ) {
@malikperang
malikperang / PHP composer tools.md
Created September 26, 2018 09:13 — forked from davebarnwell/PHP composer tools.md
Global installation of PHP tools with Composer

Global installation of PHP tools with Composer

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:

$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd
@malikperang
malikperang / docker-compose.yml
Created September 9, 2019 15:40 — forked from twang2218/docker-compose.yml
HAProxy + Nginx + PHP with client IP attached (don't forget docker daemon option `--userland-proxy=false`)
version: '2'
services:
haproxy:
image: haproxy:alpine
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
ports:
- "80:80"
depends_on:
- nginx
@malikperang
malikperang / ls-aws-ami.sh
Created April 28, 2020 19:11 — forked from arpat/ls-aws-ami.sh
List the ten latest ubuntu public images (AMI's) on AWS
# List the ten latest ubuntu public images on AWS
# Output similar to:
# 2017-09-26T16:18:51.000Z ubuntu/images/hvm-ssd/ubuntu-zesty-17.04-amd64-server-20170922 hvm True ami-5cc00825
# 2017-09-21T21:20:20.000Z ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170919 hvm True ami-17d11e6e
# 2017-09-19T10:54:43.000Z ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-20170918 hvm True ami-e872bf91
# 2017-09-05T13:12:32.000Z ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-20170831 hvm True ami-01589c78
# ...etc
aws ec2 describe-images \
--filters Name=name,Values=ubuntu/images/hvm-ssd/ubuntu* \
@malikperang
malikperang / list.txt
Created May 15, 2020 14:47 — forked from shortjared/list.txt
List of AWS Service Principals
acm.amazonaws.com
alexa-appkit.amazon.com
apigateway.amazonaws.com
application-autoscaling.amazonaws.com
appstream.application-autoscaling.amazonaws.com
appsync.amazonaws.com
athena.amazonaws.com
autoscaling.amazonaws.com
batch.amazonaws.com
channels.lex.amazonaws.com
@malikperang
malikperang / README.md
Created January 10, 2021 08:23 — forked from dalezak/README.md
Ionic Capacitor Resources Generator
  1. Run npm install cordova-res --save-dev
  2. Create 1024x1024px icon at resources/icon.png
  3. Create 2732x2732px splash at resources/splash.png
  4. Add "resources": "cordova-res ios && cordova-res android && node scripts/resources.js" to scripts in package.json
  5. Copy resources.js file to scripts/resources.js
  6. Run sudo chmod -R 777 scripts/resources.js
  7. Run npm run resources