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 / 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
@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
---
- 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)
require 'nokogiri'
require 'open-uri'
require 'terminal-notifier'
title = 'Bitcoin Gem'
activate = 'com.googlecode.iterm2'
current_price = 0
while 1
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
audio:not([controls]){display:none;}
html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
a:hover,a:active{outline:0;}
sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;}
sup{top:-0.5em;}
sub{bottom:-0.25em;}
img{max-width:100%;height:auto;border:0;-ms-interpolation-mode:bicubic;}