Skip to content

Instantly share code, notes, and snippets.


Ahmad Alfy ahmadalfy

View GitHub Profile
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": "",
"author": {
"name": "Adam Reis",
"url": ""
"license": "UNLICENSED",
nerandell /
Last active Jul 26, 2020
PHP Code Review Guidelines

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


  • 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 / 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, 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 / 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 = []'.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) {
passy /
Last active Jul 26, 2018
Using Yeoman and Jade

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


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