Skip to content

Instantly share code, notes, and snippets.

View bigprof's full-sized avatar

BigProf Software bigprof

View GitHub Profile
<?php
/* use this code as a guide for how to fetch bitcoin historical trade data from bitcoincharts, based on Bitstamp.net */
/* historical interval in hours */
define('AVERAGE_INTERVAL', 6);
$hist = file("http://api.bitcoincharts.com/v1/trades.csv?symbol=bitstampUSD&start=" . (time() - AVERAGE_INTERVAL * 3600));
if(!is_array($hist)) die("Unable to fetch data .. Try again later!");
@bigprof
bigprof / automate.js
Created June 22, 2016 19:44
Automating phantomJS using jQuery
/*
To automate phantomjs using jQuery
See also: https://github.com/ariya/phantomjs/blob/master/examples/page_events.js
*/
var url = 'http://www.sample.com'; // start url
var eval_code = function() {
// code to execute here. Use 'page' instance to navigate to other urls if needed
$("button").click();
}
@bigprof
bigprof / custom.php
Created November 27, 2017 12:43
AppGini custom page inside hooks folder
<?php
/* Assuming this custom file is placed inside 'hooks' */
define('PREPEND_PATH', '../');
$hooks_dir = dirname(__FILE__);
include("{$hooks_dir}/../defaultLang.php");
include("{$hooks_dir}/../language.php");
include("{$hooks_dir}/../lib.php");
include_once("{$hooks_dir}/../header.php");
@bigprof
bigprof / global-search.php
Last active October 1, 2022 12:34
Basic script to perform global search on all tables of an AppGini application.
<?php
/**
* Basic script to perform global search on all tables of an AppGini application.
* Create a new file inside the hooks folder and name it 'global-search.php' then copy this code to it.
* Related post: https://forums.appgini.com/phpbb/viewtopic.php?f=2&t=1689&p=4510
*/
/* Assuming this custom file is placed inside 'hooks' */
define('PREPEND_PATH', '../');
$hooks_dir = dirname(__FILE__);
@bigprof
bigprof / mysql-php-queries.php
Last active May 2, 2018 10:59
Script to display INSERT/UPDATE/SELECT queries for a specific table in a specific database (you'll be asked for these first). The queries are suitable for use in PHP programs. Don't forget to sanitize any variables before using them in your queries! Here is a short screencast showing it in action: https://www.screencast.com/t/tvyp9P1F
<?php
/* Change the values below to match your database */
$config = [
'server' => 'localhost',
'user' => 'dbuser',
'pass' => 'password'
];
if(!isset($_REQUEST['db']) || !isset($_REQUEST['table'])) {
?>
@bigprof
bigprof / phpunit.xml
Created February 17, 2019 17:30
Sample PPHUnit config
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
@bigprof
bigprof / bootstrap.php
Created February 17, 2019 17:34
Sample PHPUnit bootstrap file for an AppGini project
<?php
// my app includes
include('./app/defaultLang.php');
include('./app/lib.php');
@bigprof
bigprof / google-search.robot
Created February 20, 2019 12:43
Sample Robot Framework script for checking if a certain site appears in the first results page when searching Google for specific keywords.
*** Settings ***
Library Selenium2Library
Suite Setup start browser
Suite Teardown end browser
*** Variables ***
${browser} = ff
@bigprof
bigprof / git-deployment.md
Created April 3, 2019 17:59 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@bigprof
bigprof / footer-extras.php
Last active April 22, 2022 15:22
Add a counter column to the print preview of the table view in your AppGini app