Skip to content

Instantly share code, notes, and snippets.

View blackymetal's full-sized avatar

Ariel Patino blackymetal

View GitHub Profile
@blackymetal
blackymetal / gist_copy_mitmproxy.txt
Created June 10, 2022 13:42
How to copy request, response, curl raw data from mitmproxy
# Taken from https://stackoverflow.com/questions/21489645/get-a-raw-request-response-from-mitm-proxy
## export the current request/response as curl/httpie/raw/request/response to clipboard
# press colon : and input one of commands and enter
export.clip curl @focus
export.clip httpie @focus
export.clip raw @focus
export.clip raw_request @focus
export.clip raw_response @focus
@blackymetal
blackymetal / .ctags
Created June 12, 2020 13:19
My tags
--recurse=yes
--tag-relative=yes
--exclude=.git
--exclude="vendor"
--exclude="node_modules"
--exclude="composer.phar"
--exclude="public"
--langdef=markdown
--langmap=markdown:.md
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
@blackymetal
blackymetal / connect.php
Last active October 20, 2019 02:27
Elasticsearch point in geo_shape
<?php
/*
PUT /cities?include_type_name=true
{
"mappings": {
"_doc": {
"properties": {
"type": { "type": "keyword" },
"name": {"type": "text"},
"zone": {"type": "geo_shape"}
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\User;
class ExampleTest extends TestCase
{
@blackymetal
blackymetal / Csv.php
Created May 31, 2019 03:11
CSV reader
<?php
namespace Csv;
class Csv
{
private $path = null;
private $fh = null;
public function __construct(string $path = null)
@blackymetal
blackymetal / sonar
Last active April 8, 2019 13:15
How to install sonar
brew install sonar
brew install sonar-scanner
# File sonar-scanner.properties, on mac /usr/local/etc/sonar-scanner.properties
#Configure here general information about the environment, such as SonarQube server connection details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://localhost:9000
@blackymetal
blackymetal / laravel-ruleset.xml
Last active April 4, 2019 02:46
phpmd laravel ruleset
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Laravel and similar phpmd ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
Inspired by https://github.com/phpmd/phpmd/issues/137
using http://phpmd.org/documentation/creating-a-ruleset.html
</description>
@blackymetal
blackymetal / tree.php
Created March 23, 2018 01:15
Build tree from flat array
<?php
$elements = array(
array(
'id' => 1,
'parent_id' => null,
'info' => array('data' => '')
),
array(
'id' => 2,
'parent_id' => 1,
tmux -2 a -t session_name