Skip to content

Instantly share code, notes, and snippets.

View vishnukumarpv's full-sized avatar

VISHNUKUMAR P V vishnukumarpv

View GitHub Profile
@vishnukumarpv
vishnukumarpv / CURLphpLinkedIn.php
Last active February 20, 2023 09:33
CURL php Auth get data LinkedIn
<?php
function post_curl($url,$param="")
{
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
if($param!="")
curl_setopt($ch,CURLOPT_POSTFIELDS,$param);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
#!/bin/bash
# Declare an array to store the URLs
urls=()
# Read the URLs from the text file
while IFS= read -r line; do
urls+=($line)
done < "list.txt"
@vishnukumarpv
vishnukumarpv / 000-default.conf
Last active May 5, 2022 13:29
*.localhost virtual host
<Directory /home/zt-user/Public_Html/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
Require all granted
<?php
namespace Drupal\mymodule\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Class JsonApiArticlesController
* @package Drupal\mymodule\Controller
*/
class JsonApiArticlesController {
@vishnukumarpv
vishnukumarpv / ExampleController.php
Created February 28, 2022 05:47 — forked from rakeshjames/ExampleController.php
Drupal 8 Custom module example
<?php
/**
* @file
* @author Rakesh James
* Contains \Drupal\example\Controller\ExampleController.
* Please place this file under your example(module_root_folder)/src/Controller/
*/
namespace Drupal\example\Controller;
/**
* Provides route responses for the Example module.
$themes = array (
'reg_subscription_confirm' => array(
'variables' => array(
'body' => NULL,
),
'path' => drupal_get_path('module', '_user_reg') ,
'template' => 'templates/subscription_confirm',
),
);
@vishnukumarpv
vishnukumarpv / HOOK_custom.info
Last active July 24, 2019 12:26
module configuration form Drupal 7
name = Custom
description =
core = 7.x
package = TNM Custom
configure = admin/config/content/HOOK_custom
@vishnukumarpv
vishnukumarpv / Readme.md
Last active February 19, 2018 10:11
Bootstrap 4 form snippets

Move to user folder open your Sublime text 3 and then Preferences -> browse packages Move bootstrap_form.sublime-completions to user folder or make sub folder

example: vitext+tab

this is a personal gist.... consider it as a backup if it is helpfull for you take it

@vishnukumarpv
vishnukumarpv / jQvalidate.html
Last active January 22, 2018 16:04
Declaring jQuery Validate plugin rules inline
<input type="text" name="email" data-rule-required="true" data-rule-email="true">
<input type="text" name="password" id="passoword" data-rule-required="true" data-rule-minlength="6">
<input type="text" name="password-confirm" data-rule-required="true" data-rule-minlength="6" data-rule-equalsto="#password">
<input id="cemail" name="email" data-rule-required="true" data-rule-email="true" data-msg-email="Please enter a valid email address" />
(Tested, core)
@vishnukumarpv
vishnukumarpv / Encrypt.php
Created November 24, 2016 11:25
Encrypt and Decrypt with php
<?php
class Encrypt{
private function key( )
{
return $skey = "vishnu_kumar_aUlTIoQaBzk";
}
public function safe_b64encode($string) {
$data = base64_encode($string);
$data = str_replace(array('+','/','='),array('-','_',''),$data);