Skip to content

Instantly share code, notes, and snippets.

View juniorb2ss's full-sized avatar
🎯
Focusing

Carlos E. Oliveira juniorb2ss

🎯
Focusing
View GitHub Profile
@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
@juniorb2ss
juniorb2ss / git-update-fork.sh
Created April 23, 2018 01:56 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
'use strict';
var Promise = require('bluebird');
var AWS = require('aws-sdk');
// Check if environment supports native promises
if (typeof Promise === 'undefined') {
AWS.config.setPromisesDependency(require('bluebird'));
}
"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: |
<?php
class UserRepository {
/**
* Create new user in database
* @return \App\User User Instance
*/
public static function firstOrCreate(){
// logic
return User::firstOrCreate([
<?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