Skip to content

Instantly share code, notes, and snippets.

View thatisuday's full-sized avatar
🤖

Uday Hiwarale thatisuday

🤖
View GitHub Profile
@thatisuday
thatisuday / router.php
Last active May 10, 2016 11:30
Simple PHP REST Router for MVC Frameworks
<?php
/*
* REST INTERNAL API
* © Uday Hiwarale
* Date Created : 10/05/2016
* API Version : 1.0
**/
/*
jQuery(document).click(function(event){
event.stopPropagation();
var elem = event.target;
function traverseUp(el){
var result = el.tagName + ':nth-child(' + ($(el).index() + 1) + ')',
pare = $(el).parent()[0];
if (pare.tagName !== undefined && pare.tagName !== 'BODY'){
result = [traverseUp(pare), result].join('>');
jQuery(document).click(function(event){
event.stopPropagation();
var elem = event.target;
function traverseUp(el){
var result = el.tagName.toLowerCase() + ':eq(' + $(el).index() + ')',
pare = $(el).parent()[0];
if (pare.tagName !== undefined && pare.tagName !== 'BODY'){
result = [traverseUp(pare), result].join('>');
@thatisuday
thatisuday / allow
Created May 23, 2017 15:49 — forked from Mteigers/allow
CSF Allow AND Ignore Cloudflare IPv4 IP's.
for i in `curl https://www.cloudflare.com/ips-v4`; do csf -a $i; done
doctype html
html
head
//- Invisible comment in head section which will not appear in rendered html
// Visible comment in head block which will appear in rendered html
<!-- html comment will work fine too, but I don't get the idea! -->
body
//-
<!DOCTYPE html>
<html>
<head>
<!-- Visible comment in head block which will appear in rendered html--><!-- html comment will work fine too, but I don't get the idea! -->
</head>
<body>
<!-- "Comment can start from this line as well."
Visible comment in head block
which will appear in rendered html.
-->
//- Simple inline paragraph text
p I am inline text
//- These two pipes will create 2 new lines
|
|
//- This will add empty line between above code and below code
//-
Literal html will also work.
<p>I am inline text</p>
<p>I am literal html code </p>
<p>
Hello World!
I am Pug, your buddy to write simple HTML templates.<em>Let's explore the world, shall we?</em>Very nice to meet you :)
</p>
<p>
Hello World!
I am Pug, your buddy to write simple HTML templates.
//- An attribute but be added inside parentheses.
//- They might look similar to plain HTML attributes but value of an attribute is actually a JavaScript exprssion.
//- Below is string used as JavaScript expression.
a(href="https://google.com") google.com
//- An example of actual JavaScript expression.
//- You can separate multiple attributes using `,` or ` ` space character.
a(href="https://" + "google" + ".com", target="_blank") google.com
<a href="https://google.com">google.com</a>
<a href="https://google.com" target="_blank">google.com</a>
<img src="https://design.google.com/logo.png" alt="google logo" />
<img src="https://design.google.com/logo-medium.png" alt="google logo" />
<input type="checkbox" checked="checked" />
<input type="checkbox" checked="checked" />
<input type="checkbox" />
<input type="text" name="username" placeholder="Enter your username" required="required" />
<img src="&lt;code&gt;&lt;/code&gt;" />
<img src="<code></code>" />