Skip to content

Instantly share code, notes, and snippets.

View itolosa's full-sized avatar
🎯
Focusing

Ignacio Tolosa itolosa

🎯
Focusing
View GitHub Profile
@itolosa
itolosa / factorial.m
Created February 14, 2016 01:34
My first recursion in Objective-C
//
// main.m
//
// Created by Ignacio Tolosa on 2/13/16.
// Copyright © 2016 PasajesLA. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MyMathClass : NSObject
#xrandr --output LVDS1 --gamma 1.24:1.36:1.45 --brightness 0.9
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="pygmalion"
export UPDATE_ZSH_DAYS=14
CASE_SENSITIVE="false"
DISABLE_AUTO_TITLE="true"
COMPLETION_WAITING_DOTS="true"
@itolosa
itolosa / clock.c
Last active January 14, 2018 07:19
Clock app in C
#include <limits.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdint.h>
#include <math.h>
#include <string.h>
#ifdef __MACH__
@itolosa
itolosa / mergesort.c
Created November 2, 2016 16:21
a mergesort implementation in c language
#define ARRMAX 100
void merge(int *A, int i, int j)
{
int lk, rk, k;
int mid = (i+j)/2;
int B[j+1];
lk = i;
rk = mid+1;
k = i;
<% if policy(@post).update? %>
<%= link_to "Edit post", edit_post_path(@post) %>
<% end %>
No config file found; using defaults
statically included: /Users/nachoman/Documents/gitrepos/infrastructure/playbook/roles/geerlingguy.firewall/tasks/disable-other-firewalls.yml
statically included: /Users/nachoman/Documents/gitrepos/infrastructure/playbook/roles/jdauphant.nginx/tasks/selinux.yml
statically included: /Users/nachoman/Documents/gitrepos/infrastructure/playbook/roles/jdauphant.nginx/tasks/nginx-official-repo.yml
statically included: /Users/nachoman/Documents/gitrepos/infrastructure/playbook/roles/jdauphant.nginx/tasks/installation.packages.yml
statically included: /Users/nachoman/Documents/gitrepos/infrastructure/playbook/roles/jdauphant.nginx/tasks/ensure-dirs.yml
statically included: /Users/nachoman/Documents/gitrepos/infrastructure/playbook/roles/jdauphant.nginx/tasks/remove-defaults.yml
statically included: /Users/nachoman/Documents/gitrepos/infrastructure/playbook/roles/jdauphant.nginx/tasks/remove-extras.yml
statically included: /Users/nachoman/Documents/gitrepos/infrastructure/playbook/ro
@itolosa
itolosa / main.py
Last active April 10, 2018 02:00
API Script para conectarse con Orionx (http://orionx.io) (Orionx API) (https://api.orionx.io/graphql)
import requests
import orionx_queries
api_url = 'https://api.orionx.io/graphql'
# put your login token here
login_token = '<token-taken-from-a-sample-request>'
# put fingerprint value here
fingerprint = '<fingerprint-taken-from-a-sample-request--maybe-optional>'

Como usar la API de Orionx

  • Sin usuario logueado: Todas las peticiones deben ir en POST

  • Para usar el token (usuario logueado): Todas las peticiones deben ir en POST. Para conectarse a la api de orionx es necesario iniciar sesion en el sitio utilizando un navegador como Chrome o Firefox (ingresando el codigo de verificacion del correo) y posteriormente copiar cada uno de los Request Headers que envía este navegador para utilizarlos en las consultas a la API, es decir, deben ser añadidos a las consultas a realizar. Estos headers se pueden encontrar utilizando las herramientas de desarrollador (Developer Tools) en la pestaña Red (o Network), al hacer clic sobre una peticion realizada a la url /graphql con codigo de respuesta 200 al momento de cargar el sitio. (La api queda en api.orionx.io/graphql).

  • Para Python se puede usar la siguiente API (se deben incluir todos los headers): https://github.com/itolosa/orionx-api-client

  • Aclaración: orionx.io de ahora en adelante a

@itolosa
itolosa / example.js
Last active January 18, 2018 21:24
Funcion para formatear numeros desde orionx
mainCurrency = {
"code": "CHA",
"name": "Chaucha",
"format": "0,0.00[000000]",
"longFormat": "0,0.00000000",
"units": 8,
"symbol": "C",
"round": 0,
"wallet": {
"_id": "k7ZCcPDdDQsyQCzSm",

When you get the following on ubuntu:

virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.