Skip to content

Instantly share code, notes, and snippets.

View pntrivedy's full-sized avatar
🏠
Probably managing theitoons.com

Prerak Trivedi pntrivedy

🏠
Probably managing theitoons.com
View GitHub Profile
@pntrivedy
pntrivedy / fetchDataWithDate.tsx
Created November 4, 2023 11:41
Get data from supabase from current date to specific days, weeks, months in future.
import supbase, dayjs and apiService
function
----
const result = await apiService.fetchDataWithDate("TABLE NAME", {
field: "d", // options: d for days, w for week, M for month
value: 7, // number value. Given example will fetch rows within 7 days from current date
});
----
@pntrivedy
pntrivedy / json
Created April 18, 2017 16:16
Chrome extension manifest.json
{
// Required
"manifest_version": 2,
"name": "My Extension",
"version": "versionString",
// Recommended
"default_locale": "en",
"description": "A plain text description",
"icons": {...},
@pntrivedy
pntrivedy / meta-tags.md
Created February 27, 2017 19:54 — forked from whitingx/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@pntrivedy
pntrivedy / gist:9444f790f85d1bb10269271630b66880
Last active December 20, 2016 14:31 — forked from zxcvbnm4709/gist:2656197
include jQuery in Chrome Console
var script = document.createElement("script");
script.setAttribute("src", "//code.jquery.com/jquery-latest.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
@pntrivedy
pntrivedy / app.coffee
Last active April 28, 2016 17:19
Framerjs screen switch function
#source : https://github.com/ServusJon/PrototypeWithFramerjs
screenSwitch = (current,next) ->
next.animate
properties:
x: 0
curve: "ease-out"
time: 0.15
animationHideScreen = new Animation
layer: current
properties:
@pntrivedy
pntrivedy / app.js
Last active April 8, 2016 07:37
Angular js state authentication
//config.js
for every state you want to check if user has logged in or not set requireLogin to true.
...,
data : {
requireLogin : true
},
.....
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="format-detection" content="telephone=no" />
<title>Responsive HTML Email Template</title>
<!--End New Content Block Wrapper Row-->
<table id="bodyTable" width="100%" border="0" cellspacing="0" cellpadding="0"><!--New Content Block Wrapper Row-->
<tbody>
<tr>
@pntrivedy
pntrivedy / Get query string using fastest javascript method
Created March 12, 2014 00:21
I was searching for a way in javascript by which I can get url query parameters and found this here : http://jsperf.com/querystring-with-javascript probably the best solution.
<script>
window.getParameterByName = function(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null) return "";
else return decodeURIComponent(results[1].replace(/\+/g, " "));
}
</script>
@pntrivedy
pntrivedy / PHP mail script basic html template
Created March 12, 2014 00:13
PHP mail script with headers and html mail template.
<?php
// multiple recipients
$to = 'aidan@example.com' . ', '; // note the comma
$to .= 'wez@example.com';
// subject
$subject = 'Birthday Reminders for August';
// message
$message = '