This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class Manager { | |
| constructor() { | |
| // Speicher alle Instanzen im Manager | |
| this.instances = []; | |
| } | |
| // Filtere HTML Elemente nach einem Attribut. | |
| // So können wir die Komponenten Gruppen ausmachen. | |
| static filterNodesByAttribute(nodes, attribute, value) { | |
| return [...nodes].filter(node => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Importiere ein Modul (bspw. modals) und exportiere es direkt. | |
| // Dient nur dafür die ganzen Module unter einer Datei zu bündeln. | |
| // So lässt sich leicht durch alle Module itererieren. | |
| export { default as modals } from './modals'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Importiere das Modul aus der Lib. | |
| import Modal from '../lib/modal'; | |
| // Exportiere eine init function in der alles nötige für das Modul initialisiert wird. | |
| export default function init() { | |
| return new Modal({ | |
| nodes: document.querySelectorAll('[data-modal]'), | |
| overlay: document.querySelectorAll('[data-modal-overlay]')[0], | |
| triggers: { | |
| open: document.querySelectorAll('[data-modal-open]'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Lade alle Module aus dem Ordner und speicher Sie in der Variable ab | |
| import * as modules from './modules'; | |
| class App { | |
| constructor() { | |
| // Speicher die Module in der App | |
| this.modules = {}; | |
| } | |
| init() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Kirby .htaccess | |
| # rewrite rules | |
| <IfModule mod_rewrite.c> | |
| # enable awesome urls. i.e.: | |
| # http://yourdomain.com/about-us/team | |
| RewriteEngine on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Gallery = React.createClass({ | |
| _handleUpload(files) { //this function is called whenever a file was dropped in your dropzone | |
| _.each(files, function(file) { | |
| file.owner = Meteor.userId(); //before upload also save the owner of that file | |
| Images.insert(file, function(err, fileObj) { | |
| if (err) { | |
| console.log(err); //in case there is an error, log it to the console | |
| } else { | |
| //the image upload is done successfully. | |
| //you can use this callback to add the id of your file into another collection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Images.allow({ | |
| 'insert': function() { | |
| // add custom authentication code here | |
| return true; | |
| }, | |
| 'update': function() { | |
| // add custom authentication code here | |
| return true; | |
| }, | |
| 'remove': function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var createThumb = function(fileObj, readStream, writeStream) { | |
| gm(readStream, fileObj.name()).resize('256', '256').stream().pipe(writeStream); | |
| }; | |
| var createMedium = function(fileObj, readStream, writeStream) { | |
| gm(readStream, fileObj.name()).resize('800', '800').stream().pipe(writeStream); | |
| }; | |
| Images = new FS.Collection("images", { | |
| stores: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="class">asd</div> |