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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
</head>
<body>
<?php
include '../vendor/autoload.php';
include 'config.php';
include 'randos.php';
log('hdgfjhdgshfjgdhfhds');
use Twilio\Jwt\ClientToken;
// choose a random username for the connecting user
$identity = randomUsername();
<el-dropdown @command="deleteProject" trigger="click">
<span class="el-dropdown-link">
<i class="el-icon-more"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="project.id">Delete</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
@jagroop
jagroop / mailjet_api.php
Last active July 30, 2018 04:46
Mail Jet sample code
<?php
header('Content-Type: application/json');
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.mailjet.com/v3/REST/contactslist/1810371/managemanycontacts/100720361");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_USERPWD, "d27a3b3fef7b3050856084526c43fab3" . ":" . "2d0be36e46e8049c9ec5325869e4452e");
<?php
$public_key = 'd27a3b3fef7b3050856084526c43fab3';
$private_key = '2d0be36e46e8049c9ec5325869e4452e';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.mailjet.com/v3/REST/contactslist");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_USERPWD, $public_key . ":" . $private_key);
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" name="SKYPE_TOOLBAR">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1, user-scalable=no" name="viewport">
<link href="<?php echo site_url('assets/css/poll.css'); ?>" rel="stylesheet" type="text/css">
<title></title>
</head>
<?php
$storeFolder = 'uploads/';
// // if folder doesn't exists, create it
// if(!file_exists($storeFolder) && !is_dir($storeFolder)) {
// mkdir($storeFolder);
// }
// echo "<pre>";
// print_r($_POST);
// print_r($_FILES);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<!-- include dropzone script & style -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/dropzone.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/dropzone.js"></script>
</head>
@jagroop
jagroop / dropzone.php
Created June 20, 2018 06:26
Dropzone.js with php multiple files upload
<?php
// define absolute folder path
$storeFolder = 'ABSOLUTE_FOLDER_PATH/'
// if folder doesn't exists, create it
if(!file_exists($storeFolder) && !is_dir($storeFolder)) {
mkdir($storeFolder);
}
// upload files to $storeFolder