Skip to content

Instantly share code, notes, and snippets.

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

Joel Ibaceta joelibaceta

🏠
Working from home
View GitHub Profile
function main(splash)
use_crawlera(splash)
assert(splash:go(splash.args.url))
splash:wait(5)
button = splash:select("#MasterGC_ContentBlockHolder_RadTabStrip1 div ul li:nth-of-type(4) a")
button:click()
return {
html = splash:html()
}
@joelibaceta
joelibaceta / readme.md
Created March 15, 2020 15:31
Build PHP from source
sudo apt-get install build-essential autoconf automake libtool
wget http://launchpadlibrarian.net/ 140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb
wget http://launchpadlibrarian.net/ 140087282/bison_2.7.1.dfsg-1_amd64.deb

sudo dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb
sudo dpkg -i bison_2.7.1.dfsg-1_amd64.deb
@joelibaceta
joelibaceta / _readme.md
Last active March 10, 2020 08:26
An O(n) solution for two sum problem

Code Challenge: Two Number Sum

Write a function that takes in a non empty array of distinct integers and an integer representing a target sum. If any two numbers in the input array sum up to the target sum, the function should return them in an array. If no two numbers sum up to the target sum, the function should return an empty array. Assume that there will be at most one pair of numbers summing up to the target sum.

Solution: O(n)

def get_pair(array, target):
 hash = {}
@joelibaceta
joelibaceta / heart.sh
Last active February 10, 2020 15:15
Heart bash animation
This file has been truncated, but you can view the full file.
#!/bin/bash
echo -en ''
echo -en ''
sleep 0.033
echo -en '..................................................
..................................................
..................[38;5
@joelibaceta
joelibaceta / tree.sh
Last active December 26, 2019 22:26
tree
This file has been truncated, but you can view the full file.
#!/bin/bash
# Merry Christmas
echo -en ''
echo -en ''
sleep 0.033
echo -en '................................................................................
....................................[38
@joelibaceta
joelibaceta / body.json
Last active November 21, 2019 20:28
FraudParamsCulqi Sample
{
"amount": "300",
"currency_code": "PEN",
"email": "[email protected]",
"source_id":"tkn_test_...",
"antifraud_details": {
"first_name": "Richard",
"last_name": "Hendricks",
"address": "5230 Newell Road",
"address_city": "Palo Alto",
@joelibaceta
joelibaceta / package.json
Created November 15, 2019 21:57
Prueba de uso de webhooks
{
"name": "sampleServer",
"version": "1.0.0",
"description": "",
"main": "index.js",
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.17.1",
"request": "^2.88.0"
@joelibaceta
joelibaceta / noaa_captures.py
Created November 10, 2019 08:53
NOAA Captures
import time
import pypredict
import subprocess
satellites = ['NOAA-18','NOAA-19','NOAA-15']
freqs = [137912500, 137100000, 137620000]
sample = '44100'
wavrate='11025'
def runForDuration(cmdline, duration):
@joelibaceta
joelibaceta / validation.md
Created October 2, 2019 02:11
Culqi Prestashop validation issues

Culqi - Validation report

Addon details

Validation date: 2019-10-02 Addon type: Module Technical name: culqi Display name: Culqi

@joelibaceta
joelibaceta / palindrome.rb
Created September 23, 2019 21:53
Algorithm Test
require 'benchmark'
def iteration_way()
is_palindrome = Proc.new {|x| x.to_s == x.to_s.reverse }
max_pal = 0
(100..999).reverse_each do |i|
(100..999).reverse_each do |j|