Skip to content

Instantly share code, notes, and snippets.

👨‍💻
At Office

Jagroop Singh jagroop

👨‍💻
At Office
Block or report user

Report or block jagroop

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Auth.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Auth extends Rest_Controller {
/**
* Device types allowed in app
*/
const DEVICE_TYPES = ['ios', 'android'];
@jagroop
jagroop / Database.php
Created Nov 27, 2017
insert or update if duplicate (Bulk)
View Database.php
public static function insertOrUpdate($table, array $rows)
{
$first = reset($rows);
$columns = implode(',', array_map(function($value)
{
return "$value";
}, array_keys($first)));
$values = implode(',', array_map(function($row)
View dawghoused.html
<!-- PMA-SQL-ERROR -->
<div class="error"><h1>Error</h1>
<p><strong>SQL query:</strong>
<a href="tbl_sql.php?sql_query=SHOW+TABLE+STATUS+FROM+%60dawghoused%60+LIKE+%27dawghoused_bp_notifications%27&amp;show_query=1&amp;db=dawghoused&amp;table=dawghoused_bp_notifications&amp;token=8ec2db191e1e1dc37a8fc266da54e6eb"><span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span></a> </p>
<p>
<span class="syntax"><span class="inner_sql"><a href="./url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.6%2Fen%2Fshow.html&amp;token=8ec2db191e1e1dc37a8fc266da54e6eb" target="mysql_doc"><span class="syntax_alpha syntax_alpha_reservedWord">SHOW</span></a> <span class="syntax_alpha syntax_alpha_reservedWord">TABLE</span> <span class="syntax_alpha syntax_alpha_reservedWord">STATUS</span> <span class="syntax_alpha syntax_alpha_reservedWord">FROM</span> <span class="syntax_quote syntax_quote_backtick">`dawghoused`</span> <a href="./url.php?url=http%3A%2F%2Fdev.mys
@jagroop
jagroop / multiple_ssh_setting.md
Created Nov 28, 2017 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
View query.sql
select usr.id as user_id, first_name, last_name, bp.*, risk.* from test_type_verification as test
inner join `jbt_testeeUsers` as usr on test.user_id = usr.id
left join bp_a1c_risk_ques_2016 as bp on test.user_id = bp.user_id
left join risk_Assessment_questions_2016 as risk on test.user_id = risk.user_id
where usr.id = 133
View TournamentsController.php
<?php
namespace App\Http\Controllers\Admin\Tournaments;
use App\Http\Controllers\Controller;
use App\Models\Tournament;
use Excel;
use Illuminate\Http\Request;
use Validator;
@jagroop
jagroop / FCM_IOS.md
Last active Dec 13, 2017 — forked from rolinger/gist:d6500d65128db95f004041c2b636753a
PHP => FCM Push notification tutorial for Android and iOS
View FCM_IOS.md

Below is a full tutorial on how to setup and use Googles Firebase push notification API for both Android and iOS. It is based on this earlier implementation of Googles GCM method: https://gist.github.com/prime31/5675017 - FCM is the new method and GCM will eventually be retired.

THE BELOW METHOD IS THE NEWER FCM METHOD:

Register your app in the FCM Console: https://console.firebase.google.com (add project)

  1. Click on the newly added project, in the upper left menu is the "Overview" and Gear Settings.
  2. Click on the GEAR settings icon, and then on "Project Settings"
  3. In the main screen, click on "Cloud Messaging"
View cb-test.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<input type="text" id="sample-text" value="Lorem ipsum dolor sit amet">
View ajax.php
<?php
require 'init.php';
$done = false;
if(isset($_POST['username'], $_POST['userjob']))
{
$data = [
'name' => $_POST['username'],
You can’t perform that action at this time.