Skip to content

Instantly share code, notes, and snippets.

@erinther
erinther / hamed.css
Last active February 23, 2022 19:44
body {
background: green;
}
@erinther
erinther / SpecRunner.js
Created February 2, 2016 14:35 — forked from michaelcox/SpecRunner.js
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
@erinther
erinther / what-forces-layout.md
Created September 29, 2015 14:37 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@erinther
erinther / angularjs-dependencies.txt
Created February 5, 2014 08:35
Ways to define service dependencies
Using the array notation:
function myModuleCfgFn($provide) {
$provide.factory('myService', ['dep1', 'dep2', function(dep1, dep2) {}]);
}
Using the $inject property:
function myModuleCfgFn($provide) {
var myServiceFactory = function(dep1, dep2) {};
myServiceFactory.$inject = ['dep1', 'dep2'];
@erinther
erinther / tablelike.html
Created January 24, 2014 10:08
Table by Divs
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
<style>
.wrap{
overflow:hidden;
width:250px;
display: table;
border-collapse: collapse;
define([
], function() {
return {
componentDidMount: function() {
this._boundForceUpdate = this.forceUpdate.bind(this, null);
this.getBackboneObject().on("all", this._boundForceUpdate, this);
},
componentWillUnmount: function() {
this.getBackboneObject().off("all", this._boundForceUpdate);
},

Awesome PHP

A curated list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

@erinther
erinther / fast_button_code
Created October 4, 2013 07:29
Fast Button Code
Here we will offer some code that implements the ideas we have just discussed.
Construct the FastButton with a reference to the element and click handler.
google.ui.FastButton = function(element, handler) {
this.element = element;
this.handler = handler;
element.addEventListener('touchstart', this, false);
element.addEventListener('click', this, false);
/*global requirejs*/
requirejs.config({
shim: {
"bootstrap/js/bootstrap-affix": ["jquery"],
"bootstrap/js/bootstrap-transition": ["bootstrap/js/bootstrap-affix"],
"bootstrap/js/bootstrap-alert": ["bootstrap/js/bootstrap-transition"],
"bootstrap/js/bootstrap-button": ["bootstrap/js/bootstrap-alert"],
"bootstrap/js/bootstrap-collapse": ["bootstrap/js/bootstrap-button"],
"bootstrap/js/bootstrap-dropdown": ["bootstrap/js/bootstrap-collapse"],
"bootstrap/js/bootstrap-modal": ["bootstrap/js/bootstrap-dropdown"],
@erinther
erinther / ezfetch-to-ezfindsearch
Created September 16, 2013 07:27
ezFetch(list/tree) to ezfind(search)
ezfind.ini:
[IndexOptions]
DisableDirectCommits=true
CommitWithin=2 #(N milliseconds)
OptimizeOnCommit=disabled
site.ini
[SearchSettings]