Skip to content

Instantly share code, notes, and snippets.

@shalotelli
shalotelli / index.html
Created May 24, 2017 01:16
Creating Web Components in JavaScript (ES6) to use in your Angular, React and Ember projects
<!DOCTYPE html>
<html>
<head>
<title>Web Components</title>
<style>
body {
font-family: 'Helvetica Neue';
}
</style>
@shalotelli
shalotelli / Preferences.sublime-settings
Created March 13, 2017 17:42
My Sublime Preferences
{
"bold_folder_labels": true,
"caret_extra_bottom": 2,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Palenight.tmTheme",
"copy_with_empty_selection": false,
"ensure_newline_at_eof_on_save": true,
"font_face": "Operator Mono",
"font_options":
[
"gray_antialias"
@shalotelli
shalotelli / Crud.js
Created August 21, 2015 14:29
Node automatic rest routes
var _ = require('lodash');
function Crud(Model) {
this.Model = Model;
}
Crud.prototype.find = function(req, res) {
var criteria = {},
findMethod = 'find';
<!DOCTYPE html>
<html>
<head>
<link data-require="bootstrap-css@3.2.0" data-semver="3.2.0" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<script data-require="jquery@2.1.1" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script data-require="angular.js@1.3.0-beta.5" data-semver="1.3.0-beta.5" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.5/angular.min.js"></script>
<script src="multiselect.js"></script>
<link rel="stylesheet" href="styles/multi-select.css" />
@shalotelli
shalotelli / base_url.js
Created January 30, 2014 17:34
Javascript base_url
// return current page url
function current_url()
{
return window.location.href;
}
// return current page path
function current_path()
{
return window.location.pathname;