Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View imvision's full-sized avatar

Ali R imvision

View GitHub Profile
@imvision
imvision / code.js
Created October 31, 2019 21:02
js code
/*
Copyright 2019 PMbots Corporation
*/
/* just don't touch here */
var pathname = window.location.pathname;
var Block_further_coms = false;
var FB_version = "1.1";
var FB_runtime_version = Math.floor(Date.now() / 1000);
var FB_run = false; // Indicates if bot is running
var FB_finished = false; // Indicates if bot has finished
@imvision
imvision / ci_tools.php
Created October 26, 2019 17:42
GUI for CI Migrations
<?php
class Tools extends CI_Controller {
public function __construct() {
parent::__construct();
// can only be called from the command line
if (!$this->input->is_cli_request()) {
exit('Direct access is not allowed. This is a command line tool, use the terminal');
@imvision
imvision / scheduler.rst
Created October 22, 2019 11:50
CodeIgniter Scheduler

CI Job Scheduler

Purpose ###

To run a task once or repeatedly at a specified time.

Scheduler

public class MarketAllowed
{
public string id { get; set; }
public string name { get; set; }
public int type { get; set; }
public string startTime { get; set; }
public string marketType { get; set; }
public string parent { get; set; }
public double totalMatched { get; set; }
public string eventId { get; set; }
@imvision
imvision / dumper.bat
Created June 15, 2019 10:33
Mysqldump
"C:\xampp\mysql\bin\mysqldump.exe" --no-create-db --result-file="C:\xampp\htdocs\cidekick\web\sql\latest-dump.sql" --databases cidekick --user=root
using saleforce.SFDC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace saleforce
{
@imvision
imvision / page-api.php
Created January 3, 2016 07:09 — forked from petenelson/page-api.php
WordPress: Create a REST API endpoint
<?php
/*
* Sample code for using WordPress as a REST API endpoint (vs AJAX Admin)
* Author: Pete Nelson @GunGeekATX
*
* 1) Create a page called API in WordPres
* 2) Create a file called page-api.php in your theme directory
* 3) Add code as-needed
*
*/
@imvision
imvision / gist:20584e2e9054c35a9721
Created January 7, 2015 11:17
T-SQL Get duplicate entries
with x as (select *,rn = row_number()
over(PARTITION BY [VoucherID]
,[MTransRecord]
,[ControlID]
,[ClientID]
,[SetteldDate]
,[Debit]
,[Credit]
,[Amount]
,[Naration]
@imvision
imvision / upload_exception.php
Created August 15, 2014 12:35
File Upload Exception handling
<?php
class UploadException extends Exception
{
public function __construct($code) {
$message = $this->codeToMessage($code);
parent::__construct($message, $code);
}
private function codeToMessage($code)
@imvision
imvision / distance_calculator.php
Created August 5, 2014 06:57
Calculate distance between coordinates
* Calculate distance between two users
*/
function distanceBetween( $user_num_1, $user_num_2 ) {
$sql = "SELECT user_num,lat,lng,locationDiscovery FROM user_profile WHERE user_num in ('$user_num_1','$user_num_2')";
$qry = $this->db->query( $sql );
$users = array();
foreach( $qry->result() as $row ) {
$users[$row->user_num] = $row;
}