Skip to content

Instantly share code, notes, and snippets.

View IcodeNet's full-sized avatar
😀

Byron Thanopoulos IcodeNet

😀
View GitHub Profile
@IcodeNet
IcodeNet / json_stringify_circular_for_angular.js
Created December 2, 2015 11:57 — forked from brakmic/json_stringify_circular_for_angular.js
AngularJS-Module: Stringify JSON Objects with circular dependencies
(function () {
/* converted by @brakmic */
/* original code: https://github.com/isaacs/json-stringify-safe */
/* usage example:
*
*angular.module("myModule", ['jsonStringify'])
* .controller("MainCtrl", ['StringifyJsonService', MainCtrl]);
*
@IcodeNet
IcodeNet / Angular Overlay Directive
Created March 4, 2016 12:17 — forked from domderen/Angular Overlay Directive
Angular directive for creating dynamic overlays over any element. Directive is automatically preparing parent to have an overlay, and dynamically sets the height of the overlay if the height of the parent will change. Second directive allows to set any element in the vertical and horizontal center of the parent element. It dynamically reposition…
var overlayModule = angular.module('angular-overlay', []).directive('elementOverlay', [function () {
return {
restrict: 'A',
link: function (scope, elem, attrs) {
$(elem[0].parentNode).css('position', 'relative');
scope.$watch(function () {
return $(elem[0].parentNode).height();
}, function (v) {
elem.css('height', v + 'px');
@IcodeNet
IcodeNet / webpack.config.js
Created May 8, 2016 14:33 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
import 'script!history.js/scripts/bundled/html4+html5/jquery.history';
import 'script!jquery.cookie';
/**
* These function calls bootstrap all of the global files, essentially requiring them in
* to mimic concat behavior. This is a temporary solution until we begin `require`ing utilities
* into page level JS rather than referencing them as globals.
* RegEx excludes files that have already been required in a specific order or those that should be omitted.
*
*/
import {isJSON} from '../utils/is-json';
import request from './superagent';
export async function({method = 'GET', url}) {
method = method.toUpperCase();
const methods = ['GET', 'POST'];
let [foundMethod] = methods.filter(m => method === m);
if (!foundMethod) {
throw new Error('you specified an unknown method')
"scripts": {
"dev-server": "webpack-dev-server — config webpack-dev-server.config.js — progress — colors — port 2992 — inline",
"hot-dev-server": "webpack-dev-server — config webpack-hot-dev-server.config.js — hot — progress — colors — port 2992 — inline",
"build": "webpack — config webpack-production.config.js — progress — profile — colors",
"start-dev": "node lib/server-development",
"start": "node lib/server-production"
}
@IcodeNet
IcodeNet / selenium_node_install.bat
Created October 25, 2016 20:19 — forked from koola/selenium_node_install.bat
Install Selenium grid node as a windows service
@echo off
powershell.exe -executionpolicy unrestricted -command "%~dp0\selenium_node_install.ps1 -nodes ie -hub 192.168.1.1"
REM powershell.exe -executionpolicy unrestricted -command "%~dp0\selenium_node_install.ps1 -nodes ie,chrome -hub 192.168.1.1"
REM powershell.exe -executionpolicy unrestricted -command "%~dp0\selenium_node_install.ps1 -nodes ie,chrome,firefox -hub 192.168.1.1"
pause
@IcodeNet
IcodeNet / package.json
Created October 27, 2016 13:07 — forked from SteveAquino/package.json
Install protractor with a specific version of chrome driver.
{
"name": "protractor-webdriver-2-16-test",
"devDependencies": {
"protractor": "latest",
},
"scripts": {
"webdriver:version": "sed -i.bak 's/\"chromedriver\": \"[0-9\\.]*\"/\"chromedriver\": \"2.16\"/' node_modules/protractor/config.json",
"webdriver:update": "./node_modules/protractor/bin/webdriver-manager update",
"postinstall": "npm run webdriver:version && npm run webdriver:update"
}
@IcodeNet
IcodeNet / settings.json
Created May 2, 2017 15:15 — forked from JohannesHoppe/settings.json
VSCode: proxy settings
// VSCode: Place your settings in this file to overwrite the default settings
{
"http.proxy": "http://user:pass@proxy.com:8080",
"https.proxy": "http://user:pass@proxy.com:8080",
"http.proxyStrictSSL": false
}
@IcodeNet
IcodeNet / microsyntax.md
Created June 1, 2017 07:57 — forked from mhevery/microsyntax.md
Angular microsyntax gramar

Microsyntax

Microsyntax in Angular allows you to write <div *ngFor="let item of items">{{item}}</div> instead of <ng-template ngFor [ngForOf]="items"><div>{{item}}</div></ng-template.

Constraints

The microsyntax must:

  • be know ahead of time so that IDEs can parse it without knowing what is the underlying semantics of the directive or what directives are present.
  • must translate to key-value attributes in the DOM.