Skip to content

Instantly share code, notes, and snippets.

View auxcoder's full-sized avatar
🗼
Working from home

AuxCoder auxcoder

🗼
Working from home
View GitHub Profile
@auxcoder
auxcoder / .eslintrc
Created January 3, 2017 18:20 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@auxcoder
auxcoder / client-side-intercom-update.js
Last active January 12, 2017 18:28
Intercom widget integration with Google Tag Manager as a Custom HTML Tag
// in this example the logged user data is a binded var in an angular controller
// place code in a parent controller to run this code one time
// any time this data change we should run this code again
window.Intercom('update', {
email: vm.user.email,
user_id: vm.user.id,
name: vm.user.first_name + ' ' + vm.user.last_name,
last_login: vm.user.last_login,
from_app: 'Office', // custom attr
from_screen: $state.current.name, // custom attr
@auxcoder
auxcoder / hybrid-facade-pattern.js
Created January 13, 2017 21:43
Angular services as a useable patterns for any method
// service
angular.module('myApp').service('request', ['$http', function($http) {
var Request = function() {
// Convenience helpers
this.endpoints = {
user: 'user',
login: 'user/login'
};
this.apiBase = 'http://myserver.com/api/';
@auxcoder
auxcoder / apple-devises-media-queries.md
Created January 24, 2017 14:49
CSS Media Queries for iPads & iPhones
@auxcoder
auxcoder / angularjs_directive_attribute_explanation.md
Created February 23, 2017 18:09 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
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>
@auxcoder
auxcoder / sass-lists-loops-control.md
Last active February 28, 2017 14:51
Examples of control flow and loop iteration in SASS

Sass control flow and loop iterations

@if @else

The @if control directive takes an expression and processes its block of styles if the expression is true. This example let us define styles base in the devise orientation.

@mixin iPad($orientation: null){
	@media only screen
@auxcoder
auxcoder / dev-tools-tips.md
Last active March 9, 2017 21:56
Chrome Dev Tools Tips

Chrome Dev Tools tips

Interpolation

Insert data into message.

var myVar = 123;
console.log('Var value is %s', myVar);
console.log(`Var value is ${myVar}`);
@auxcoder
auxcoder / upgrade-guide.md
Last active July 20, 2017 13:30 — forked from joho/gist:3735740
PostgreSQL upgrade steps and common commands

Steps to install and run PostgreSQL using Homebrew (Mac OS X)

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Rename the old version and update PostgreSQL

mv /usr/local/var/postgres /usr/local/var/postgres91
brew update
@auxcoder
auxcoder / version-modifiers.md
Created July 31, 2017 20:03
Versions && prefixies meaning

When defining dependencies some prefixes are used.

"dependencies": {
  "a": "~1.0.6",
  "b": "^1.0.6",
  "b": "*"
}
@auxcoder
auxcoder / convert-img-to-base64.js
Created August 2, 2017 15:18
Converting an image to base64 encode from its url
// from a component controller
toDataURL(
image_url
).then(
function onsuccess(response) {
ctrl.ngModel.$setViewValue(ctrl.previousImage);
},
function onError(response) {
$log.error(response);
}