Skip to content

Instantly share code, notes, and snippets.

@mewm
mewm / sitecustomize.py
Created October 29, 2015 21:07
Fix SSL winrm error win2012 on mac el capitan default python 2.7 - create /Library/Python/2.7/site-packages/sitecustomize.py with the content below
import ssl
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
# Legacy Python that doesn't verify HTTPS certificates by default
pass
else:
# Handle target environment that doesn't support HTTPS verification
ssl._create_default_https_context = _create_unverified_https_context
git log --pretty=format:'%s' | tr '[:upper:]' '[:lower:]' | tr '[:space:]' '\n' | sort | uniq -c | sort -nr | grep -iE "(fuck|shit|bitch|damn|pis)"
<?php
//Define options
$options = new ArrayObject(array(
'a',
'b',
'c',
'd',
'e',
'f'
^\s*($|#|\w+\s*=|(\*(?:\/\d+)?|(?:[0-5]?\d)(?:-(?:[0-5]?\d)(?:\/\d+)?)?(?:,(?:[0-5]?\d)(?:-(?:[0-5]?\d)(?:\/\d+)?)?)*)\s+(\*(?:\/\d+)?|(?:[01]?\d|2[0-3])(?:-(?:[01]?\d|2[0-3])(?:\/\d+)?)?(?:,(?:[01]?\d|2[0-3])(?:-(?:[01]?\d|2[0-3])(?:\/\d+)?)?)*)\s+(\*(?:\/\d+)?|(?:0?[1-9]|[12]\d|3[01])(?:-(?:0?[1-9]|[12]\d|3[01])(?:\/\d+)?)?(?:,(?:0?[1-9]|[12]\d|3[01])(?:-(?:0?[1-9]|[12]\d|3[01])(?:\/\d+)?)?)*)\s+(\*(?:\/\d+)?|(?:[1-9]|1[012])(?:-(?:[1-9]|1[012])(?:\/\d+)?)?(?:,(?:[1-9]|1[012])(?:-(?:[1-9]|1[012])(?:\/\d+)?)?)*|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\s+(\*(?:\/\d+)?|(?:[0-6])(?:-(?:[0-6])(?:\/\d+)?)?(?:,(?:[0-6])(?:-(?:[0-6])(?:\/\d+)?)?)*|mon|tue|wed|thu|fri|sat|sun)\s+|(@reboot|@yearly|@annually|@monthly|@weekly|@daily|@midnight|@hourly)\s+)([^\s]+)\s+(.*)$
@mewm
mewm / gist:7759143
Last active December 30, 2015 01:59
<?php
#On top of routes (got it in a service provider, but put it here because I have to debug)
App::bind('\Mewm\Shop\Storage\Category\CategoryRepository', function($app) {
return new \Mewm\Shop\Storage\Category\CategoryEloquent();
});
......
#CategoryEloquent looks like this
namespace Mewm\Shop\Storage\Category;
@mewm
mewm / foo.py
Last active January 3, 2016 00:59
#!/usr/bin/env python
"""
Create, read, update, append and delete file test
"""
import sys, os
class FileOperation():
<?php
$_flatArray = [];
$_nestedArray = [
[
'id' => 1,
'name' => 'A',
'subcategories' => [
[
'id' => 2,
@mewm
mewm / index.php
Created April 12, 2016 22:00
SOLID made simple
<?php
class ATM
{
public function __construct()
{
}
public function withdrawByCard()
Dear Amazon RDS Customer,
You are receiving this email because you currently have one or more active Amazon RDS for MariaDB database instances running version 10.0.17 or 10.1.14. We are performing this maintenance to improve instance reliability. Maintenance will be scheduled during your weekly maintenance window beginning on October 25th, 2016 at 00:00 UTC.
Your impacted MariaDB instances are listed below:
US East (N. Virginia) - db1
US East (N. Virginia) - db2
US East (N. Virginia) - db3
<svg viewBox="0 0 100 100" style="display: block; width: 100%;"><path d="M 50,50 m 0,-43.5 a 43.5,43.5 0 1 1 0,87 a 43.5,43.5 0 1 1 0,-87" stroke="transparent" stroke-width="1" fill-opacity="0"></path><path d="M 50,50 m 0,-43.5 a 43.5,43.5 0 1 1 0,87 a 43.5,43.5 0 1 1 0,-87" stroke="rgb(246,80,102)" stroke-width="13" fill-opacity="0" style="stroke-dasharray: 273.357, 273.357; stroke-dashoffset: 136.679;"></path></svg>