Skip to content

Instantly share code, notes, and snippets.

Ahmad Alfy ahmadalfy

Block or report user

Report or block ahmadalfy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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();
@nodesocket
nodesocket / bootstrap.flatten.css
Last active Jul 7, 2019
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;
@benjamingrobertson
benjamingrobertson / lazy-video-loader.js
Last active May 20, 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 (
@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.