Skip to content

Instantly share code, notes, and snippets.

View williankeller's full-sized avatar
💻
Software engineer

Willian Keller williankeller

💻
Software engineer
View GitHub Profile
export PATH="$HOME/.symfony/bin:$PATH"
export PATH="$HOME/.composer/vendor/bin:$PATH"
source ~/.profile
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
#php7.0.33
#php7.1.32
#php7.2.22
PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php7.2.22/bin:$PATH
/**
* @param $url
* @param null $requestBody
* @return array
* @throws LocalizedException
*/
public function createRequest($url, $requestBody = null): array
{
$curl = curl_init();
@williankeller
williankeller / .bashrc
Created March 12, 2019 14:54
Display current branch in terminal
# GIT Folder Defines
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0m\]"
# Function to Custom Prompt with Current GIT Branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
PS1="\n$GREEN\u@\h$NO_COLOR:\w\n$YELLOW\$(parse_git_branch)$NO_COLOR\$
<?php
public function afterGetUserId(\Magento\Webapi\Model\Authorization\TokenUserContext $subject, $result)
{
/** @param Request $requestHeader **/
$integration = $this->requestHeader->getHeader('custID');
if (!empty($integration)) {
static $customer = null;
if ($customer) {
<?php
class Account {
/**
* {@inheritdoc}
*/
public function isCustomerBlocked($return = false)
{
if ($this->helper->isBlockedActive() && $this->customerSession->getIsCustomerBlocked() == 1) {
<?php
namespace OrderService\Resources\Simulation;
use OrderService\Resources\AbstractTransferBuild;
class TransferBuild extends AbstractTransferBuild
{
/**
@williankeller
williankeller / import-tar-gz.sh
Created November 9, 2017 14:05
Command to import a tar.gz file to MySQL
tar xzOf dump.sql.tar.gz | mysql -u [user] -p [database]
$('.preview-thumb.fold').each(function(){
$element = $(this);
$element.css({
'perspective': ($element.width() * 1.54)
});
});
@williankeller
williankeller / console.js
Created October 10, 2017 13:26
Avoid `console` errors in browsers that lack a console.
(function () {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
];
var length = methods.length;