Skip to content

Instantly share code, notes, and snippets.

@git-toni
git-toni / gist:9493495
Last active August 29, 2015 13:57
Good resources for OTP + Ruby / Rails
Via Rails
https://moocode.com/posts/3-using-the-google-authenticator-app-with-rails
Using mainly poRuby:
http://bradylove.com/blog/2013/02/15/dead-simple-time-based-otp-with-google-authenticator/
@git-toni
git-toni / rainforest.rb
Created November 15, 2014 19:52
Rainforest challenge
#!/bin/env
require 'httparty'
require 'cgi'
require 'pry'
myid=995287801
200.times do |i|
begin
response=HTTParty.get("http://letsrevolutionizetesting.com/challenge.json?id=#{myid}")
@git-toni
git-toni / app.js
Created April 20, 2015 17:04
Brunch + Riot troubles
(function() {
'use strict';
var globals = typeof window === 'undefined' ? global : window;
if (typeof globals.require === 'function') return;
var modules = {};
var cache = {};
var has = ({}).hasOwnProperty;
@git-toni
git-toni / MyTest.js
Last active March 25, 2016 18:35
Testing Mithriljs module
;(function(){
var test = require('tape');
//global.XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
global.XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var m = require('mithril');
var Module = require('../module.js');
var config={
url:'/urltoken',
title:'Hello there'
}
@git-toni
git-toni / mock.js
Created March 25, 2016 20:50
Testing a mithril.js module
mock = (function () {
"use strict"
var window = {}
window.window = window
var document = window.document = {
// FIXME: add document.createRange().createContextualFragment()
import * as edit from 'react-edit';
class MyTable extends React.Component{
constructor(props){
super(props)
this.state={
editedCell:null,
rows:[],
columns:[],
title: props.title
@git-toni
git-toni / index.js
Last active November 19, 2016 17:04
Mobx-React Provider test
import React,{Component} from 'react'
import ReactDOM from 'react-dom'
import {observable} from 'mobx'
import {observer, Provider} from 'mobx-react';
const store=observable({
num:33,
name:'john'
})
@git-toni
git-toni / cyclic.js
Created November 22, 2016 11:20
mobx cyclic error
//StoreA.js
import importedB from './StoreB'
class StoreA{
@observable fieldA
@computed get computedA(){
return `I'm a ${this.fieldA} derived from ${importedB.computedB}`
}
}
{"success"=>true,
"terms"=>"https://currencylayer.com/terms",
"privacy"=>"https://currencylayer.com/privacy",
"timestamp"=>1483803068,
"source"=>"USD",
"quotes"=>
{"USDAED"=>3.672804,
"USDAFN"=>66.730003,
"USDALL"=>128.399994,
"USDAMD"=>483.440002,
{
"NOGUEEEEEEEEy":"byeeee",
"numero": 445345345
}