Skip to content

Instantly share code, notes, and snippets.

View molekilla's full-sized avatar

Rogelio Morrell molekilla

  • Panama
View GitHub Profile
@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 / howto-saml-cookie.md
Last active October 21, 2025 07:05
Integrating hapi cookie with hapi passport saml v1.1.0
@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 / 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 / App.tsx
Last active June 5, 2019 19:49
Odenplan with WC mock wallet
public initWallet = async () => {
const local = localStorage ? localStorage.getItem("walletconnect") : null;
if (local) {
let session;
try {
session = JSON.parse(local);
} catch (error) {
throw error;
@molekilla
molekilla / buyorder.sol
Created June 13, 2019 19:23
better course material
uint buyBookOffersCount;
uint pairsAmountBuyPrices;
// Contains a buy book order offers
// dict[pairIndex, price, offerIndex]
mapping (uint => mapping(uint => mapping(uint => Offer))) buyBookOffers;
// TokenPairInfo eg ETH/PAX, ETH/PAX
mapping (uint => TokenPairInfo) pairs;
@molekilla
molekilla / gist:1e949cccc36685fabc510905a6c66c7d
Created July 8, 2019 19:54
svelte server render example
<!-- Main -->
<script lang="ts">
import Table from "./AccountingTable.svelte";
export let accountingGroupByPairs = {};
</script>
<svelte:head>
<link
rel="stylesheet"
@molekilla
molekilla / solido-contract-store.ts
Last active November 5, 2019 21:10
tracking contract state
import { validate } from './Utils';
import { IMethodOrEventCall } from '../types';
import { SolidoContract } from '../core/SolidoContract';
export type TrackStateBy = 'polling' | 'storeUpdates' | 'push';
// TODO: Add to SolidoContract
// subjects - RxJS subjects for methods
CREATE DEFINER=`root`@`localhost` PROCEDURE `calc_depreciacion_2`()
BEGIN
DECLARE finished INTEGER DEFAULT 0;
DECLARE depre INTEGER DEFAULT 0;
DECLARE valor_original DECIMAL(10,2);
DECLARE porc_depreciacion DECIMAL(10,2);
DECLARE codigo_cuenta VARCHAR(25);
DECLARE estado INTEGER DEFAULT 0;
DECLARE id_activo INTEGER DEFAULT 0;
DECLARE fecha_compra DATE;