Skip to content

Instantly share code, notes, and snippets.

Avatar

Abhinav Kulshreshtha Abhinav1217

View GitHub Profile
@Abhinav1217
Abhinav1217 / search.sh
Created Jul 29, 2020 — forked from jonlabelle/search.sh
Bash script to search file contents (by file extension) for the specified search term. Uses grep under the hood.
View search.sh
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2086,SC2155,SC2001,SC2048
#
# Search file contents (by file extension) for the specified search term.
#
# grep options:
#
# -i Perform case insensitive matching.
# −r Recursively search subdirectories listed.
View _brightness.scss
// Brightness math based on:
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function sqrt ($r) {
// http://www.antimath.info/css/sass-sqrt-function/
View dynamic-svg-image-placeholders.markdown

Dynamic SVG image placeholders

How it works

  1. Loads the Potrace Lib (6KB min+gzip)
  2. Starts loading the full res source image
  3. Meanwhile...
  4. Grabs a low res thumbnail from Cloudinary (~5KB)
  5. Uses Potrace to generate an svg from the thumbnail
  6. Colours and fades the SVG in as a crisp, full-size placeholder
@Abhinav1217
Abhinav1217 / certificate.sh
Created Dec 6, 2018 — forked from volkancakil/certificate.sh
A basic Self Signed SSL Certificate utility
View certificate.sh
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to
@Abhinav1217
Abhinav1217 / ..git-pr.md
Created Aug 25, 2018 — forked from gnarf/..git-pr.md
git pr - Global .gitconfig aliases for Pull Request Managment
View ..git-pr.md

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@Abhinav1217
Abhinav1217 / stickyTitles.js
Created Dec 17, 2015 — forked from andrewlaskey/stickyTitles.js
Sticky Instagram-like Headers
View stickyTitles.js
//http://stackoverflow.com/questions/13279725/getting-a-sticky-header-to-push-up-like-in-instagrams-iphone-app-using-css-a
function stickyTitles(stickies) {
this.load = function() {
stickies.each(function(){
var thisSticky = jQuery(this).wrap('<div class="followWrap" />');
thisSticky.parent().height(thisSticky.outerHeight());
View laravel_virtualhost_nginx.conf
server {
listen 80;
server_name www.example.com;
root /var/www/vhosts/example.com/public/;
location /
{
index index.php index.html index.htm;
}