Skip to content

Instantly share code, notes, and snippets.

View imparvez's full-sized avatar

Parvez Shaikh imparvez

  • 1Spatial
  • Newcastle Upon Tyne, United Kingdom
View GitHub Profile
@bradtraversy
bradtraversy / docker_wordpress.md
Last active June 19, 2024 17:24
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active June 25, 2024 22:17
Online Resources For Web Developers (No Downloading)
@claytongulick
claytongulick / template.js
Last active June 25, 2022 23:32
if statement inside string template literals and lit-html.
//a quick example of how to use actual 'if' statements inside template literals,
//without using ternary operator. Sometimes this is cleaner if you have complex conditionals or nested conditionals.
//data param is passed in via render(template(data), this) - if not using lit-html, could be any function
template = (data) => html`
<div id="job_edit" class="modal">
<div class="modal-content">
${
//we're just going to wrap an anonymous inline function here and then call it with some data
(job => { //job here, is just an example, it could be anything, it's passed in below in (data.job)
if(job)
scss/ # Import all ‘-dir.scss’ files
|
|- abstracts/
| |- __abstracts-dir.scss # Import all abstracts .scss files
| |- _fonts.scss # Font Import
| |- _mixins.scss # Scss Mixins
| |- _variables.scss # Scss Variables
|
|- base/
| |- __base-dir.scss # Import all base .scss files
@mbeaudru
mbeaudru / Checkbox.js
Created March 22, 2017 09:06
Checkbox with styled-components
import React, { Component, PropTypes } from 'react';
import styled from 'styled-components';
class Checkbox extends Component {
render() {
return (
<Styled
onClick={() => this.props.onChange(!this.props.checked)}
>
<input
@Vintharas
Vintharas / gulp.config.js
Last active July 17, 2018 07:59
Sample gulpfile for a complete pipeline with ES6 and SASS
/* eslint strict: [2, "global"] */
'use strict';
/*** Main paths ***/
var projectRoot = './',
root = './myProject.web/', // project root
index = root + 'Views/Shared/Layouts/',
src = root + 'Content/', // source code
temp = root + 'temp/', // temporary folder
dist = src + 'dist/', // generated code
@jacurtis
jacurtis / _spacing-helpers.scss
Last active May 30, 2024 17:41
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active June 14, 2024 19:05
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {