Skip to content

Instantly share code, notes, and snippets.

View nire0510's full-sized avatar

Nir Elbaz nire0510

  • Holisto
View GitHub Profile
@nire0510
nire0510 / google-webfont-loader.js
Created November 26, 2015 11:02
Dynamically download and serve web-fonts from Google's repo for better performance
(function (window) {
'use strict';
// Global configuration for web-font:
window.WebFontConfig = {
google: {
families: [ 'Oxygen:700,400:latin' ]
},
timeout: 2000
};
@nire0510
nire0510 / file.css
Last active November 16, 2015 19:49
Angular Services
html, body {
height: 100%;
width: 100%;
margin: 0;
}
body {
background-color: #ededed;
}
@nire0510
nire0510 / es6class.js
Created October 27, 2015 21:35
ES6/2015 class
'use strict';
class Person {
constructor (strName) {
this._name = strName;
console.log('My name is', this._name);
}
eat () {
console.log(this._name, 'is eating!');
}
@nire0510
nire0510 / file.html
Created October 16, 2015 09:50
AngularJS - 2 modules, One page
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AngularJS - 2 modules, One page</title>
<meta name="feditor:preset" content="default"/>
</head>
<body>
<div id="first" data-ng-app="SampleApp1">
@nire0510
nire0510 / history.sql
Last active September 19, 2017 15:22
[MS SQL History] Search query in MSSQL queries history #database
SELECT t.[text]
FROM sys.dm_exec_cached_plans AS p
CROSS APPLY sys.dm_exec_sql_text(p.plan_handle) AS t
WHERE t.[text] LIKE N'%PART_OF_YOUR_QUERY%';
@nire0510
nire0510 / .jscsrc
Last active January 20, 2016 11:02
JSCS configuration file
// http://jscs.info/rules.html
{
"verbose": true,
"excludeFiles": ["node_modules/**", "bower_components/**", ".tmp/**"],
"maxErrors": 20,
"disallowAnonymousFunctions": true,
//"disallowCapitalizedComments": true,
//"disallowCommaBeforeLineBreak": true,
"disallowCurlyBraces": null,
@nire0510
nire0510 / jscs-settings-extraction.md
Last active August 29, 2015 14:23
Extracts all jscs settings to your clipboard
  1. Open JSCS - Rules page
  2. Open your browser's console and run the following script:
var objSettings = {};

[].forEach.call(document.querySelectorAll('.rule-list__item a'), function (element) {
  objSettings[element.text] = true;
});
@nire0510
nire0510 / file.css
Last active August 29, 2015 14:23
Foundation ui framework kitchen sink
body {
}
@nire0510
nire0510 / debounce.js
Created June 7, 2015 10:56
7 Essential JavaScript Functions
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
@nire0510
nire0510 / singleton.js
Last active September 19, 2017 15:28
[Singleton Boilerplate] #javascript
var Singleton = (function () {
var instance;
function createInstance() {
var object = new Object("I am the instance");
return object;
}
return {
getInstance: function () {