Skip to content

Instantly share code, notes, and snippets.

View kunalvarma05's full-sized avatar
🎧
No.

Kunal Varma kunalvarma05

🎧
No.
View GitHub Profile
@kunalvarma05
kunalvarma05 / index.htm
Last active May 5, 2022 15:59
AJAX Contact Form with PHP
<!DOCTYPE HTML>
<html>
<head>
<title>Welcome to my Website</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="send.js"></script>
</head>
<body>
<h1>A Simple AJAX Contact Form</h1>
<form method="post" action="" id="contact_form">
/**
* Function: sanitize
* Returns a sanitized string, typically for URLs.
*
* Parameters:
* $string - The string to sanitize.
* $lowercase - Force the string to lowercase?
* $alnum - If set to *true*, will remove all non-alphanumeric characters.
*/
function sanitize($string, $lowercase = true, $alnum = false) {
@kunalvarma05
kunalvarma05 / leaflet-google.js
Created August 1, 2013 08:57 — forked from crofty/leaflet-google.js
An awesome leaflet.js plugin to integrate google map tiles in leaflet.js.
/*
* L.TileLayer is used for standard xyz-numbered tile layers.
*/
L.Google = L.Class.extend({
includes: L.Mixin.Events,
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,
@kunalvarma05
kunalvarma05 / 0_reuse_code.js
Created June 5, 2014 21:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Auto-Split Fields

A simple demonstration of form fields which split on change. The name field, on change, splits into two fields, first name and last name. The email field, splits into two fields, the email itself and the username. The password field splits into the password and a password confirmation field which needs to be filled by the user.

This concept could probably reduce the form filling time.

A Pen by Kunal Varma on CodePen.

License.

[
{
"keys": ["ctrl+shift+f"], "command": "reindent","args": {"single_line": false}
},
{
"keys": ["ctrl+shift+n"], "command": "advanced_new_file_new"
},
{
"keys": ["ctrl+shift+a"], "command": "toggle_side_bar"
},
{
"always_show_minimap_viewport": true,
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
"characters": "/",
@kunalvarma05
kunalvarma05 / after.sh
Created February 27, 2016 22:39 — forked from cluppi/after.sh
Turning SSL on for Homestead
#!/bin/sh
# Config for SSL.
echo "--- Making SSL Directory ---"
mkdir /etc/nginx/ssl
echo "--- Copying $i SSL crt and key ---"
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com"
echo "--- Turning SSL on in nginx.conf. ---"
@kunalvarma05
kunalvarma05 / gulpfile.js
Created July 1, 2016 20:34 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@kunalvarma05
kunalvarma05 / DeCryptor.java
Created February 24, 2017 15:56 — forked from JosiasSena/DeCryptor.java
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/