Skip to content

Instantly share code, notes, and snippets.

@eristoddle
eristoddle / fix_udev.sh
Created July 10, 2014 02:30
Fix for node-webkit on Ubuntu 14.04 error while loading shared libraries: libudev.so.0
sudo ln -sf /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0
@givanse
givanse / after-render.js
Last active May 22, 2016 15:26
afterRenderEvent mixin
import Ember from 'ember';
export default Ember.Mixin.create({
/*
This hook is guaranteed to be executed when the root element of this view has been inserted into the DOM.
*/
didInsertElement : function(){
this._super();
Ember.run.scheduleOnce('afterRender', this, this.afterRenderEvent);
@johnnncodes
johnnncodes / gist:8436644
Created January 15, 2014 13:54
Using custom validation messages in Sails.js. Credits to: sfb_
/**
* Takes a Sails Model object (e.g. User) and a ValidationError object and translates it into a friendly
* object for sending via JSON to client-side frameworks.
*
* To use add a new object on your model describing what validation errors should be translated:
*
* module.exports = {
* attributes: {
* name: {
* type: 'string',
@Rhincodon
Rhincodon / ddd.md
Created March 5, 2015 18:06
DDD [Перевод]

Источник

Вопрос

Привет, Jeffrey.

Было бы здорово если бы вы сделали скринкаст по DDD. Я уже начал изучать и читать о DDD, но это кажется мне трудным и сложным для понимания. Я верю что вы можете помочь нам лучше понять DDD.

Спасибо.

Ответ

@Rhincodon
Rhincodon / ddd-structure.md
Last active January 15, 2017 11:52
Структура приложения и пространств имён при DDD

Источник

Вопрос

Как лучше организовать структуру моего приложения используя DDD и Laravel 4 или 5?

Ответ

Я обычно разделяю большие приложения на 4-5 пространств имён, которые привязаны к глобальному app пространству имён. Например, я хочу создать приложение ToDo List, так что базовое пространство имён будет ToDo.

@mishschmid
mishschmid / closest-alternative.js
Last active September 6, 2017 06:10
Nice little js helper to replace jQuery's "closest" method
// https://plainjs.com/javascript/traversing/get-closest-element-by-selector-39/
// Matches polyfill
Element.prototype.matches = Element.prototype.matches ||
Element.prototype.matchesSelector ||
Element.prototype.webkitMatchesSelector ||
Element.prototype.msMatchesSelector ||
function (selector) {
var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1;
while (nodes[++i] && nodes[i] !== node);
sudo curl -sSL https://get.docker.com/ | sh
cd
curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`uname -s`-`uname -m` > ./docker-compose
sudo mv ./docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
cd
git clone https://github.com/Mashpy/testphp.git
docker-composer up -d
@zmts
zmts / info.md
Last active February 2, 2018 20:08
Vue.js Global SASS/SCSS variables

Используем SASS переменные в Vue.js (webpack template)

Есть несколько вариантов решить эту проблему

  • импортить файл с переменными в каждый компонент
  • использовать лоадер для Вебпака sass-resources-loader что бы переменные были доступны глабально

Ставим sass-resources-loader npm install sass-resources-loader --save-dev

Правим build/utils.js

@mikermcneil
mikermcneil / annotated_example.js
Last active July 8, 2018 18:51
Client-side (browser) example of a socket.io client for Sails.js <http://sailsjs.org>
// example.js
// ===============================
//
// Client-side (browser) example of how you might connect a socket.io client
// to your Sails backend.
// For the latest docs on talking to Sails via socket.io, check out the new reference section in the Sails docs:
// https://github.com/balderdashy/sails-docs/blob/master/reference/SocketClient.md
// As for some great tutorials, my best recommendation would be to check out @irlnathan's sailscasts:
@0xadada
0xadada / github-latest-release.sh
Created July 8, 2015 15:56
Download latest GitHub project release
curl -LOk `curl --silent https://api.github.com/repos/jasmine/jasmine/releases/latest | /usr/bin/awk '/browser_download_url/ { print $2 }' | /usr/bin/sed 's/"//g'`