Skip to content

Instantly share code, notes, and snippets.

@plugn
plugn / datepicker.js
Created January 19, 2017 21:13 — forked from icai/datepicker.js
vue 2 directive with jqueryui
Vue.directive('datepicker', {
bind: function (el, binding, vnode, oldVnode) {
$(el).datepicker({
onSelect: function (date) {
vnode.context.date = date;
}
});
},
update: function (el, binding, vnode, oldVnode) {
$(el).datepicker('setDate', binding.value);
@plugn
plugn / osx-homebrew-setup.md
Created January 12, 2017 17:23 — forked from sr75/osx-homebrew-setup.md
Mac Yosemite OSX - Homebrew (RVM/MySQL/Redis) setup

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2

@plugn
plugn / index.html
Created September 2, 2016 12:53 — forked from anonymous/index.html
Пример отображения геометрии - Sputnik Maps JS API // source http://jsbin.com/labogiq
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Пример отображения геометрии - Sputnik Maps JS API</title>
<link rel="stylesheet" href="http://maps-js.apissputnik.ru/v0.3/sputnik_maps_bundle.min.css"/>
<script src="http://maps-js.apissputnik.ru/v0.3/sputnik_maps_bundle.min.js"></script>
<script src="http://maps-js.apissputnik.ru/v0.3/docs/examples/clusters_data.js"></script>
@plugn
plugn / protovis_to_link.js
Created May 10, 2016 22:58 — forked from jweir/protovis_to_link.js
How to save SVG data to a file from a web browser
// Throttle from underscore.js, simplified and deattached
var throttle = function(func, wait) {
var context, args, result;
var timeout = null;
var previous = 0;
var later = function() {
previous = Date.now();
timeout = null;
result = func.apply(context, args);
@plugn
plugn / state.js
Created April 18, 2016 13:28 — forked from joladev/state.js
Simple AngularJS State Service for sharing state between controllers.
angular.module('services', [])
.factory('State', function ($rootScope) {
'use strict';
var state;
var broadcast = function (state) {
$rootScope.$broadcast('State.Update', state);
};
var update = function (newState) {
@plugn
plugn / here-maps-js-api.html
Last active April 8, 2016 12:00 — forked from anonymous/index.html
here maps js api // source http://jsbin.com/tadipi
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<link rel="stylesheet" type="text/css"
href="https://js.api.here.com/v3/3.0/mapsjs-ui.css" />
<script type="text/javascript" charset="UTF-8"
src="https://js.api.here.com/v3/3.0/mapsjs-core.js"></script>
<script type="text/javascript" charset="UTF-8"
src="https://js.api.here.com/v3/3.0/mapsjs-service.js"></script>
@plugn
plugn / ng-md-flex-column.html
Last active February 9, 2016 11:43 — forked from anonymous/index.html
ng md flex column
<html lang="en" >
<head>
<!--http://jsbin.com/gapatikuwo -->
<!-- Angular Material style sheet -->
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.css">
</head>
<body ng-app="BlankApp" ng-cloak>
<style rel="stylesheet">
body {
@plugn
plugn / Collection.js
Created November 10, 2015 15:31
JS ActiveRecord
import Dispatcher, {EventObject} from "Dispatcher";
/**
* Items collection
*/
export default class Collection {
static E_ADD = 'add';
static E_REMOVE = 'remove';
static E_CHANGE = 'change';
@plugn
plugn / regex.js
Created November 5, 2015 11:39 — forked from Integralist/regex.js
The difference between JavaScript's `exec` and `match` methods is subtle but important, and I always forget...
var str = "The quick brown fox jumped over the box like an ox with a sox in its mouth";
str.match(/\w(ox)/g); // ["fox", "box", "sox"]
// match (when used with a 'g' flag) returns an Array with all matches found
// if you don't use the 'g' flag then it acts the same as the 'exec' method.
str.match(/\w(ox)/); // ["fox", "ox"]
/\w(ox)/.exec(str); // ["fox", "ox"]