Skip to content

Instantly share code, notes, and snippets.

View dmk1111's full-sized avatar
🐢
Working

Dmytro Holysh dmk1111

🐢
Working
View GitHub Profile
@dmk1111
dmk1111 / angularjs-get-injector.js
Last active April 24, 2018 11:28
get angular service from console
var injector = angular.element(document.querySelector('*[ng-app]')).injector();
var myService = injector.get("myService");
// You can call service methods from console now
//info taken this question: from https://stackoverflow.com/questions/15527832/how-can-i-test-an-angularjs-service-from-the-console
@dmk1111
dmk1111 / Google-Sheet-Form-Post.md
Created November 16, 2017 12:35 — forked from willpatera/Google-Sheet-Form-Post.md
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Run example

You should be able to just open index.html in your browser and test locally.

However if there are some permissions errors you can make a quick html server with python. Open terminal and cd to the directory where the gist files are located and enter python -m SimpleHTTPServer. By default this creates a local server at localhost:8000

@dmk1111
dmk1111 / node-ubuntu-upstart-service.md
Created November 16, 2017 08:47 — forked from willrstern/node-ubuntu-upstart-service.md
Run Node.js App as Ubuntu Upstart Service

###The Issue With Forever Forever is great for running node services, with a minor setback: the word "forever" doesn't apply to system reboots.

###The solution, run node apps as a system service logged in as root

vim /etc/init/node-app.conf

Contents for node-app.conf

@dmk1111
dmk1111 / Random-string
Created November 9, 2017 18:57 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@dmk1111
dmk1111 / *.md
Created September 12, 2017 10:09
Component versus Directive in AngularJS

Component versus Directive in AngularJS

.component()

Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.

What is the role of .component()?

  • Declares new HTML via a template or templateUrl
  • Should be used to create Components as part of a Component architecture