Skip to content

Instantly share code, notes, and snippets.

View molekilla's full-sized avatar

Rogelio Morrell molekilla

  • Panama
View GitHub Profile
@molekilla
molekilla / readme.md
Created May 19, 2019 22:22
Solido boilerplate

Solido boilerplate

  • Listen for .sol changes
  • Compile
  • Compile ABI export
  • Hot reload webpack
@molekilla
molekilla / deprecia.java
Created January 8, 2019 00:35
Deprecia MEF
package com.sigag.scheduler.jobs;
import io.reactivex.Observable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.DateFormat;
@molekilla
molekilla / howto-saml-cookie.md
Last active April 17, 2020 12:49
Integrating hapi cookie with hapi passport saml v1.1.0
@molekilla
molekilla / request_rest_call.ps1
Created January 26, 2018 22:06
Requests a REST API with Basic Authentication
# Call REST API
$SecurePassword = Get-Content httpbin_creds.txt | ConvertTo-SecureString -Key (1..16)
$Username = "johnlopez"
$cred = New-Object System.Management.Automation.PSCredential ($Username, $SecurePassword)
Invoke-RestMethod -Uri "http://httpbin.org/basic-auth/$Username/password123456789" `
-Method Get -Credential $cred -ContentType "application/json" -Body $json
@molekilla
molekilla / encrypt.ps1
Created January 26, 2018 22:05
Write secure string with powershell
# Write secure string as file
Write-Output "Ingrese contraseña: "
$Secure = Read-Host -AsSecureString
$Encrypted = ConvertFrom-SecureString -SecureString $Secure -Key (1..16)
$Encrypted | Set-Content httpbin_creds.txt
$Secure2 = Get-Content httpbin_creds.txt | ConvertTo-SecureString -Key (1..16)
$Secure2
Write-Output "Archivo encriptado como httpbin_creds.txt exitosamente"
@molekilla
molekilla / jwt java signing
Created June 27, 2017 14:00
jwt java signing
private String createBearerToken() throws Exception {
byte[] decoded = ("-----BEGIN RSA PRIVATE KEY-----\n" +
"-----END RSA PRIVATE KEY-----\n").getBytes();
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
PEMParser pemParser = new PEMParser(new BufferedReader(new InputStreamReader(new ByteArrayInputStream(decoded))));
JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider("BC");
Object object = pemParser.readObject();
KeyPair kp = converter.getKeyPair((PEMKeyPair) object);
java.security.interfaces.RSAPrivateKey generatedPvk = (java.security.interfaces.RSAPrivateKey)kp.getPrivate();
const bot$ = Rx.Observable.from(request(postReq));
bot$.mergeMap((body) => {
const byCedulaResp = menio.parse(body, 'subscribers');
const req = Object.assign({}, postReq, {
form: {
selectsuscriptor: byCedulaResp.subs[0],
}
});
return Rx.Observable.from(request(req));
})
context: 'td',
props: {
tipo: function ($scope) {
// either return or assign to this.model
return $scope.eq(0).text();
},
fecha: function ($scope) {
return $scope.eq(1).text();
}
@molekilla
molekilla / gist:979960da22d49c6c8446
Last active August 29, 2015 14:06
required only after ng blur and ng change
<!-- parcialmente basado en yearofmoo.com -->
<form name="formulario">
<div class="field">
<label for="correo">Correo Electronico:</label>
<input type="email"
name="correo" ng-change="MiCtrl.checkRequired(datos.email)" ng-blur="MiCtrl.checkRequired(datos.email)"
ng-model="datos.email"
/>
<div ng-messages="formulario.correo.$error">
<div ng-message="required">Campo requerido</div>