Skip to content

Instantly share code, notes, and snippets.

Avatar

Ali R imvision

View GitHub Profile
View code.js
/*
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 Oct 26, 2019
GUI for CI Migrations
View ci_tools.php
<?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 Oct 22, 2019
CodeIgniter Scheduler
View scheduler.rst

CI Job Scheduler

Purpose ###

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

Scheduler

View MarketAllowed.cs
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; }
View dumper.bat
"C:\xampp\mysql\bin\mysqldump.exe" --no-create-db --result-file="C:\xampp\htdocs\cidekick\web\sql\latest-dump.sql" --databases cidekick --user=root
View F3_AccountOperation.cs
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 Jan 3, 2016 — forked from petenelson/page-api.php
WordPress: Create a REST API endpoint
View page-api.php
<?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 Jan 7, 2015
T-SQL Get duplicate entries
View gist:20584e2e9054c35a9721
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 Aug 15, 2014
File Upload Exception handling
View upload_exception.php
<?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 Aug 5, 2014
Calculate distance between coordinates
View distance_calculator.php
* 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;
}
You can’t perform that action at this time.