Skip to content

Instantly share code, notes, and snippets.

View gurindersingh's full-sized avatar

Gurinder Chauhan gurindersingh

View GitHub Profile
@gurindersingh
gurindersingh / Countries.json
Created December 5, 2016 02:19
Countries List JSON
{
"4":{
"capital":"Kabul",
"citizenship":"Afghan",
"country-code":"004",
"currency":"afghani",
"currency_code":"AFN",
"currency_sub_unit":"pul",
"full_name":"Islamic Republic of Afghanistan",
"iso_3166_2":"AF",
@gurindersingh
gurindersingh / 1-add-middleware.php
Created February 15, 2018 17:26 — forked from adamwathan/1-add-macros.php
Multiformat Endpoints in Laravel
<?php
namespace App\Http\Middleware;
class CaptureRequestExtension
{
public function handle($request, $next)
{
if ($request->route()->parameter('_extension') !== null) {
$request->attributes->set('_extension', substr($request->route()->parameter('_extension'), 1));
@gurindersingh
gurindersingh / html-head-boilerplate.html
Created February 20, 2018 08:33 — forked from nunosans/html-head-boilerplate.html
HTML Head Boilerplate & Reference
<!doctype html>
<html>
<head>
<!-- Priority tags. These must come first. -->
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge; chrome=1"> <!-- Render Chrome if available or using latest version of Internet Explorer (Recommended). -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<!-- Document Title -->
<title>Page Title</title>
<!-- Allows control over where resources are loaded from. Place as early in the document as possible, only applies to content below this tag. -->
@gurindersingh
gurindersingh / meta-tags.md
Created June 24, 2018 20:05 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link 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'>
@gurindersingh
gurindersingh / iptables_rules.sh
Created November 7, 2018 01:32 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@gurindersingh
gurindersingh / rules-both.iptables
Created November 7, 2018 01:32 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@gurindersingh
gurindersingh / states.json
Created January 3, 2019 13:19
Countries & States
{
"AD": [
{
"name": "Andorra la Vella",
"country_short_name": "AD"
},
{
"name": "Canillo",
"country_short_name": "AD"
},
@gurindersingh
gurindersingh / generate-ssh-key.sh
Created January 25, 2019 11:44 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
# name
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
Host github.com
User git
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa