Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View alexanmtz's full-sized avatar
🎯
Focusing

Alexandre Magno alexanmtz

🎯
Focusing
View GitHub Profile

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@alexanmtz
alexanmtz / build_openssl_dylib.sh
Created December 2, 2020 14:02 — forked from tmiz/build_openssl_dylib.sh
Build latest OpenSSL Universal Binary on OSX
#!/bin/bash
OPENSSL_VERSION="1.0.1o"
curl -O -L http://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
mv openssl-$OPENSSL_VERSION openssl_i386
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
mv openssl-$OPENSSL_VERSION openssl_x86_64
cd openssl_i386
@alexanmtz
alexanmtz / install-openssl-from-src-mac
Last active December 2, 2020 11:26 — forked from byronmansfield/install-openssl-from-src-mac
Install OpenSSL from source Mac OS X
# Install older OpenSSL 1.0.0 from source on Mac OS X to install Ruby version compatible (like 1.8.7)
# prepare workspace
mkdir -p ~/code/build-from-src/ && cd $_
# download source code
curl -LO https://www.openssl.org/source/openssl-1.0.0.tar.gz
# expand tar
tar -xzvf openssl-1.0.0.tar.gz
@alexanmtz
alexanmtz / put_post_json_rails_5_integration_test.md
Created September 26, 2020 00:49 — forked from dteoh/put_post_json_rails_5_integration_test.md
PUT or POST JSON in a Rails 5 ActionDispatch::IntegrationTest

In Rails 5, the preferred base class for testing controllers is ActionDispatch::IntegrationTest.

If you have an API that receives parameters as JSON request bodies, here are some helper methods to facilitate testing:

class ActionDispatch::IntegrationTest
  def put_json(path, obj)
    put path, params: obj.to_json, headers: { 'CONTENT_TYPE' => 'application/json' }
  end
@alexanmtz
alexanmtz / dummy_controller.rb
Created September 26, 2020 00:20 — forked from psobocinski/dummy_controller.rb
Asserting on a JSON response in a Rails controller test with MiniTest
class DummyController < ApplicationController
def do
render json: { balance: 50 }
end
end
@alexanmtz
alexanmtz / app.js
Created October 3, 2019 09:33
A simple line to disable yellow warnings when debugging React Native apps. You can place anywhere in your React Native application if want to test. You have an option to disable different levels that you can use
console.disableYellowBox = true;
// console.ignoredYellowBox = ['Warning:'];
@alexanmtz
alexanmtz / Drawer-menu.js
Last active May 3, 2021 18:49
A tab menu example using Material-UI for react
// styles
const styles = theme => ({
iconContainer: {
display: 'none',
[theme.breakpoints.down('sm')]: {
display: 'block'
}
}
})
@alexanmtz
alexanmtz / java_home_android.sh
Created July 16, 2019 12:00
Setting a JAVA_HOME in order to run android apps
# where jdk1.8.0_211.jdk is the target version in this example
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
@alexanmtz
alexanmtz / print.css
Created June 23, 2019 09:43
A example of a media query used for print
@media print {
#header, #location, #sidebar, #footer, #respond, #wpml_credit_footer {
display: none;
}
#content {
width: 95%;
}
.entry {
padding: 0;
margin: 0;
@alexanmtz
alexanmtz / gist:ff05ea8e944d95bd5649852bf484e214
Created June 5, 2019 08:39 — forked from sergiosvieira/fluxo-trabalho-git.md
Fluxo de Trabalho do Git para Pequenas Equipes
Fluxo de Trabalho no Git
========================
Primeiro crie um branch de desenvolvimento no seu repositório local:
$ git checkout --track origin/development
1. Trabalhe em sua tarefa, continuamente comitando em intervalos regulares para manter
o rastro daquilo que você fez.