Skip to content

Instantly share code, notes, and snippets.

Avatar

Ahmad Alfy ahmadalfy

View GitHub Profile
@adamreisnz
adamreisnz / package.json
Last active Aug 4, 2020
Simple pure npm scripts build process
View package.json
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@nerandell
nerandell / code-review-checklist.md
Last active Jul 26, 2020
PHP Code Review Guidelines
View code-review-checklist.md

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
@nodesocket
nodesocket / bootstrap.flatten.css
Last active May 2, 2020
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
View bootstrap.flatten.css
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@benrobertsonio
benrobertsonio / lazy-video-loader.js
Last active Nov 4, 2019
Lazy Loading Video Based on Connection Speed
View lazy-video-loader.js
class LazyVideoLoader {
constructor() {
this.videos = [].slice.call(document.querySelectorAll('.hero__bgvideo'));
// Abort when:
// - The browser does not support Promises.
// - There no videos.
// - If the user prefers reduced motion.
// - Device is mobile.
if (
View autoUnsubscribe-ivy-hoc.ts
export function autoUnsubscribe(subscriptions: string[] = []) {
return (componentType) => {
const orgFactory = componentType.ngComponentDef.factory;
componentType.ngComponentDef.factory = (...args) => {
const component = orgFactory(...args);
componentType.ngComponentDef.onDestroy = () => {
if (component.ngOnDestroy) {
component.ngOnDestroy();
@passy
passy / jade.md
Last active Jul 26, 2018
Using Yeoman and Jade
View jade.md

Using Yeoman and Jade

Getting started

  • Make sure you have yo installed: npm install -g yo
  • Run: yo webapp
  • Install grunt-contrib-jade: npm install grunt-contrib-jade --save-dev

Customization

anonymous
anonymous / Gruntfile.js
Created Jul 27, 2015
Sharing Configuration with Grunt
View Gruntfile.js
module.exports = function(grunt) {
require('./config.js')(grunt);
grunt.registerTask('default', ['concat', 'less', 'jshint', 'watch']);
};
You can’t perform that action at this time.