Skip to content

Instantly share code, notes, and snippets.

View FernandoEscher's full-sized avatar
🏠
Working from home

Fernando Irias Escher FernandoEscher

🏠
Working from home
  • Tegucigalpa, Honduras
View GitHub Profile
@FernandoEscher
FernandoEscher / rarible.ts
Created June 24, 2022 17:20
Sample code reading collections from rarible
import FormData from "form-data"
import fetch from "node-fetch";
import { TezosWallet } from "@rarible/sdk-wallet"
// eslint-disable-next-line camelcase
import { in_memory_provider } from "@rarible/tezos-sdk/dist/providers/in_memory/in_memory_provider"
import { Blockchain } from "@rarible/api-client"
import { createRaribleSdk } from "@rarible/sdk/build"
// Dependencies.
(global as any).FormData = FormData;
@FernandoEscher
FernandoEscher / streamable.sh
Created April 15, 2015 14:53
FFMpeg settings for streaming video
ffmpeg -i input.mov -profile:v high -level 4.1 -movflags +faststart -vcodec libx264 -r 24 -s 1280x720 -preset slow -crf 24 -acodec libfaac -ac 2 -ab 128k -threads 4 -tune zerolatency output.mp4
@FernandoEscher
FernandoEscher / curl-succeeds.sh
Last active August 29, 2015 14:18
Run curl until the request succeeds
until [ $? -eq 0 ]; do curl -I --fail example.com; done
Febrero 2010
http://www.laprensa.hn/honduras/505754-97/mario-zelaya-nuevo-director-del-seguro
Junio 2010
http://archivo.elheraldo.hn/Ediciones/2010/06/29/Noticias/Lobo-analiza-pago-de-1-523-millones-al-IHSS
Agosto 2010
http://old.latribuna.hn/2010/08/11/doctor-mario-zelaya/
Enero 2011
---
- hosts: localhost
tasks:
- name: ensure Git is installed
apt: pkg=git state=present
- name: ensure Nginx is installed
apt: pkg=nginx state=present
- name: ensure Monit is installed
apt: pkg=monit state=present
@FernandoEscher
FernandoEscher / honduras_municipios.rb
Created December 4, 2013 05:16
Seed de todos los municipios de Honduras para ActiveRecord
department = Departamento.create(:name=>"ATLANTIDA",:num=>1)
Municipio.create(:name=>"LA CEIBA",:num=>1,:departamento_id=>department.id)
Municipio.create(:name=>"EL PORVENIR",:num=>2,:departamento_id=>department.id)
Municipio.create(:name=>"ESPARTA",:num=>3,:departamento_id=>department.id)
Municipio.create(:name=>"JUTIAPA",:num=>4,:departamento_id=>department.id)
Municipio.create(:name=>"LA MASICA",:num=>5,:departamento_id=>department.id)
Municipio.create(:name=>"SAN FRANCISCO",:num=>6,:departamento_id=>department.id)
Municipio.create(:name=>"TELA",:num=>7,:departamento_id=>department.id)
Municipio.create(:name=>"ARIZONA",:num=>8,:departamento_id=>department.id)
department = Departamento.create(:name=>"COLON",:num=>2)
#!/usr/bin/env bash
apt-get -y update
apt-get -y upgrade
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
curl -L https://get.rvm.io | bash
source /etc/profile.d/rvm.sh
rvm requirements
rvm install 2.0.0
source /etc/profile.d/rvm.sh
gem install chef ruby-shadow --no-ri --no-rdoc
def point_at_distance(center, distance, bearing=180)
pi = Math::PI
r_e = 6378137.0 #meters
d = distance/r_e
lat1 = (pi/180) * center.latitude
lng1 = (pi/180) * center.longitude
tc = (pi/180) * bearing
y = Math.asin(Math.sin(lat1)*Math.cos(d)+Math.cos(lat1)*Math.sin(d)*Math.cos(tc))
def self.circle_path(center, radius, complete_path = false)
# For increased accuracy, if your data is in a localized area, add the elevation in meters to r_e below:
r_e = 6378137.0
@@d2r ||= Math::PI/180
@@multipliers ||= begin
segments = 16
dRad = 2*Math::PI/segments
(segments + (complete_path ? 1 : 0)).times.map do |i|
rads = dRad*i
y = Math.sin(rads)
@FernandoEscher
FernandoEscher / buy.js
Last active November 28, 2017 12:54 — forked from chenosaurus/buy.js
//you will need to install node.js and restler first
//npm install restler
//run with the following command
// node buy.js
var sys = require('util'),
rest = require('restler');
//set these to your coinbase API key, the amount you want to buy & the price that you're expecting for