NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
App configuration in environment variables: for and against | |
For (some of these as per the 12 factor principles) | |
1) they are are easy to change between deploys without changing any code | |
2) unlike config files, there is little chance of them being checked | |
into the code repo accidentally | |
3) unlike custom config files, or other config mechanisms such as Java |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
<?php | |
// Assign this to models and implement these methods | |
interface ShouldBeValidated | |
{ | |
/** | |
* Returns an array of key => value rules (as per normal Laravel validation) | |
* | |
* @return array |
<?php namespace GR\Clan; | |
use Illuminate\Database\Eloquent\Model; | |
use GR\Section\SectionInterface; | |
use GR\Member\MemberInterface; | |
use GR\Lib\ModelCache; | |
use GR\Member\Member; | |
class Clan extends Model implements ClanInterface | |
{ |
<?php namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Request; | |
use View; | |
use App; | |
abstract class ApplicationsServiceProvider extends ServiceProvider | |
{ | |
public function register() |
Hello software developers,
Please check your code to ensure you're not making one of the following mistakes related to cryptography.
#! /usr/bin/python | |
# This script is taken (unmodified except for this comment) from: https://s3.amazonaws.com/reinvent2013-sec402/SecConfig.py | |
# Talk: http://www.slideshare.net/AmazonWebServices/intrusion-detection-in-the-cloud-sec402-aws-reinvent-2013 | |
# Example code to output account security config | |
__author__ = 'Greg Roth' | |
import boto | |
import urllib |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
<?xml version="1.0" encoding="UTF-8"?> | |
<opml version="1.0"> | |
<head> | |
<title>Subscriptions - freek@spatie.be</title> | |
</head> | |
<body> | |
<outline text="PHP" title="PHP"> | |
<outline htmlUrl="http://frederickvanbrabant.com" title="frederickvanbrabant.com" xmlUrl="http://frederickvanbrabant.com/feed.xml" type="rss" text="frederickvanbrabant.com"/> | |
<outline htmlUrl="http://mattallan.org" title="mattallan.org" xmlUrl="http://mattallan.org/feed.xml" type="rss" text="mattallan.org"/> | |
<outline title="asked.io" xmlUrl="https://asked.io/rss" type="rss" text="asked.io"/> |
import AWS from 'aws-sdk/global' | |
import eventEmitter from 'event-emitter' | |
import differenceInMilliseconds from 'date-fns/difference_in_milliseconds' | |
import minDate from 'date-fns/min' | |
// Set this to match your setup | |
const env = { | |
awsRegion: XXXX, | |
identityPoolId: XXXX, | |
userPoolId: XXXX, |