Skip to content

Instantly share code, notes, and snippets.

View mischah's full-sized avatar
:octocat:
afk // brb

Michael Kühnel mischah

:octocat:
afk // brb
View GitHub Profile
@toddmotto
toddmotto / *.md
Last active April 25, 2023 09:06
Component versus Directive in AngularJS

Component versus Directive in AngularJS

.component()

Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.

What is the role of .component()?

  • Declares new HTML via a template or templateUrl
  • Should be used to create Components as part of a Component architecture
# Put this in your .zshrc or .bashrc file
# Install `tree` first — brew install tree
function t() {
# Defaults to 3 levels deep, do more with `t 5` or `t 1`
# pass additional args after
tree -I '.git|node_modules|bower_components|.DS_Store' --dirsfirst --filelimit 15 -L ${1:-3} -aC $2
}

Hello!

You've published a series of packages that depend on all packages in the npm registry, probably using this program: https://github.com/Ell/npm-gen-all

We’re not entirely sure what your motivations are for creating this series of packages, but we have some concerns.

First, these packages violate npm's Terms of Use. Much like a squatter package, these have no individual functionality beyond depending on other packages. As a result, we intend to remove them from the registry this afternoon.

It seems that these series of packages might be a response to the events of last week and recent changes to our unpublish policy. A few community members are concerned that series of packages like the ones you’ve created will make unpublishing packages completely impossible after the 24 hour window. This is not the case. These series of packages are not valid package dependents because they violate th

var chai = require('chai');
var expect = chai.expect;
var sinon = require('sinon');
var sinonChai = require('sinon-chai');
chai.use(sinonChai);
var eventBus = (function () {
var _eventHandler = null;
@krnlde
krnlde / makepdf.es6.js
Last active August 29, 2015 14:23
This script handles HTTP POST requests and returns a generated, streamed PDF filled with the contents of the POST. You need to install wkhtmltopdf globally on your system first. You can either provide form data key value pairs or JSON data. It'll both be parsed to JSON and put into handlebars. Install all the imports via npm.
"use strict";
import fs from 'fs';
import express from 'express';
import bodyParser from 'body-parser';
import Handlebars from 'handlebars';
import wkhtmltopdf from 'wkhtmltopdf';
const app = express();
app.use(bodyParser.json());
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active May 6, 2024 12:29
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@anthonyholmes
anthonyholmes / bootstrap-sass-mixin-cheatsheet.scss
Created October 10, 2014 08:13
Bootstrap Sass Mixin Cheatsheet
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@benedfit
benedfit / _critical.scss
Last active November 25, 2021 12:36
Critical CSS using Sass and Jekyll
$critical-css-only:true !default;
@mixin critical($critical-only:true){
@if (($critical-css-only and $critical-only) or (not $critical-css-only and not $critical-only)){
@content;
}
}
@hdragomir
hdragomir / sm-annotated.html
Last active March 5, 2024 08:57
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);