Skip to content

Instantly share code, notes, and snippets.

View jagroop's full-sized avatar
👨‍💻
At Office

Jagroop Singh jagroop

👨‍💻
At Office
View GitHub Profile
@jagroop
jagroop / multiple_ssh_setting.md
Created November 28, 2017 19:55 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

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"
@jagroop
jagroop / query.sql
Last active December 1, 2017 05:22
Query
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
@jagroop
jagroop / TournamentsController.php
Created December 5, 2017 19:44
Import Excel Laravel
<?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 December 13, 2017 05:03 — forked from rolinger/gist:d6500d65128db95f004041c2b636753a
PHP => FCM Push notification tutorial for Android and iOS

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"
@jagroop
jagroop / blog.md
Last active December 13, 2017 17:51
Delete git history
#!/bin/bash

git checkout --orphan latest_branch # Checkout
git add -A # Add all the files
git commit -am "first commit" # Commit the changes
git branch -D master # Delete the branch
git branch -m master # Rename the current branch to master
git push -f origin master # Finally, force update your repository
sendMessageIos
<!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">
@jagroop
jagroop / ajax.php
Last active February 21, 2018 10:33
<?php
require 'init.php';
$done = false;
if(isset($_POST['username'], $_POST['userjob']))
{
$data = [
'name' => $_POST['username'],
@jagroop
jagroop / parse_string.php
Last active March 1, 2018 05:40
PHP Parse string and Limit Characters
<?php
function parseString($text, $limit = 100, $end = '')
{
$text = preg_replace("/[\r\n]+/", "\n", $text);
$value = stripslashes(preg_replace("/\s+/", ' ', $text));
if (mb_strlen($value) <= $limit) {
return $value;
}
return rtrim(mb_substr($value, 0, $limit, 'UTF-8')) . $end;
<?php
require 'vendor/autoload.php';
require 'helpers.php';
$randomTxt = "jagroop singh.";
$redeemdesc = 'Reward entitles you to one night of Romance with Giver. Giver will take all necessary steps to create the mood and conditions to spark the';
$redeemPoint = '750';
$title = 'Reward title';
$firstReply = parseString($randomTxt);
$from = 'jagroop';