Skip to content

Instantly share code, notes, and snippets.

@felippenardi
felippenardi / readme.md
Last active February 1, 2024 11:06
Benchmarking AngularJS performance

Benchmarking AngularJS performance

Things to optmize

  • Use one-time-bind on expressions ( {{::value}} )
  • Replace $scope.$apply() with $scope.$digest() whenever possible
  • Move filters to controllers

Measuring Watch list

To get the total watchers on the current page, you can run this script on the browser console:

@a-double
a-double / flex-embeds.css
Created March 11, 2015 21:31
Flexible media embeds
/* https://github.com/suitcss/components-flex-embed/blob/master/lib/flex-embed.css */
.flex-embed {
display: block;
position: relative;
overflow: hidden;
}
.flex-embed-inner {
display: block;
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active December 11, 2025 18:28
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@AndersDJohnson
AndersDJohnson / bootstrap-version-detect.js
Last active June 5, 2019 13:28
Bootstrap version detect
/**
* Hacks to detect Bootstrap version (2 vs. 3) from JavaScript.
* Does some detection of stringified functions - should be safe against most minification, but please test!
*
* Example:
* ```js
* bootstrapVersionDetect.isVersion('2', $);
* ```
*
* May not be necessary soon for Bootstrap 3+, @see https://github.com/twbs/bootstrap/pull/13578
@demisx
demisx / angularjs-providers-explained.md
Last active August 26, 2025 03:06
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@korya
korya / Subfolder to git repo.md
Last active August 21, 2025 16:19
Convert subfolder into Git submodule
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active September 18, 2025 20:18
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>