Skip to content

Instantly share code, notes, and snippets.

View juniorb2ss's full-sized avatar
🎯
Focusing

Carlos E. Oliveira juniorb2ss

🎯
Focusing
View GitHub Profile
"use strict";
console.log("AWS Lambda SES Forwarder // @arithmetric // Version 3.0.0");
// Configure the S3 bucket and key prefix for stored raw emails, and the
// mapping of email addresses to forward from and to.
//
// Expected keys/values:
// - fromEmail: Forwarded emails will come from this verified address
// - emailBucket: S3 bucket name where SES stores emails.
packages:
yum:
newrelic-php5: []
php56-imap: []
rpm:
newrelic: http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
commands:
configure_new_relic:
command: newrelic-install install
env:
commands:
create_post_dir:
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/99_create_cron_jobs.sh":
mode: "000755"
owner: root
group: root
content: |
@juniorb2ss
juniorb2ss / gist:1bc2e1fc25c17f7b03262a735d063d3a
Created July 4, 2016 19:36
Commands to ElasticBeanstalk
commands:
00_update_composer:
command: export HOME=/root && export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: COMPOSER_HOME
value: /root
- namespace: aws:elasticbeanstalk:application:environment
option_name: HOME
@juniorb2ss
juniorb2ss / gist:44244114f6fe6e6ab1bb2b2ad69c3fdf
Created July 4, 2016 19:32
Set timezone in ElasticBeanstalk
commands:
set_time_zone:
command: ln -f -s /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
Files:
"/etc/php.d/sp-timezone.ini" :
mode: "000644"
owner: root
group: root
content: |
date.timezone = America/Sao_Paulo
<?php
class UserRepository {
/**
* Create new user in database
* @return \App\User User Instance
*/
public static function firstOrCreate(){
// logic
return User::firstOrCreate([
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker-OceanicNext.tmTheme",
"font_options":
[
"gray_antialias"
],
"font_size": 8,
"ignored_packages":
<?php
$string = 'http://meusite.com.br/wp-admin.php';
$BlackListURL = ["wp-admin.php", "admin", "administrator", "wp-login.php"];
/** Procure por uma parte da string no texto **/
function hasString($search, $text, &$found) {
if (!is_array($search)) {
$search = [
<?php
$dates = [
'07/04/2016', # 0
'08/04/2016', # 1
'09/04/2016', # 2
'10/04/2016', # 3
'11/04/2016', # 4
'12/04/2016', # 5
'13/04/2016', # 6
SELECT
users.name,
chars.*,
guild.name as 'guild_name'
FROM
char_wstats as chars
JOIN pvpm_data as users ON chars.char_id = users.id
JOIN guild ON chars.char_id = guild.char_id
ORDER BY
chars.kill_count DESC