Skip to content

Instantly share code, notes, and snippets.

Avatar
Undefined is not a function

Ivan Mrvelj imrvelj

Undefined is not a function
View GitHub Profile
@imrvelj
imrvelj / markdown.md
Created Feb 22, 2017 — forked from rikukissa/POST.md
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom
View markdown.md

Testing Angular.js app headlessly with node.js + mocha

Lean unit tests with minimal setup

Code examples

Keypoints

  • Fake DOM (Everything works without a real browser)
  • Uses ngMocks to inject and mock Angular.js dependencies
  • I'm assuming you are already using browserify (but everything works fine without it)
View seemfoni
$username = $request->request->get('username');
$password = $request->request->get('password');
if(is_null($username) || is_null($password)) {
return new Response(
'Please verify all your inputs.',
Response::HTTP_UNAUTHORIZED,
array('Content-type' => 'application/json')
);
}
@imrvelj
imrvelj / README.md
Created Jan 19, 2017 — forked from tjamps/README.md
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle
View README.md

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

View Infinality *buntu
sudo add-apt-repository ppa:no1wantdthisname/ppa && apdejt && apti fontconfig-infinality
# configuration
sudo bash /etc/fonts/infinality/infctl.sh setstyle
/etc/profile.d/infinality-settings.sh -> open -> USE_STYLE = [ OSX || DEFAULT || UBUNTU ]
View angular-just-say-no.md

Angular: Just say no

A collection of articles by AngularJS veterans, sometimes even core committers, that explain in detail what's wrong with Angular 1.x, how Angular 2 isn't the future, and why you should avoid the entire thing at all costs unless you want to spend the next few years in hell.

Reason for this: I'm getting tired of having to explain to everyone, chief of which all the indiscriminate Google Kool-Aid™ drinkers, why I have never believed in Angular, why I think it'll publicly fail pretty soon now (a couple years), and why it's a dead end IMO. This gist serves as a quick target I can point people to in order not to have to parrot / compile the core of the articles below everytime. Their compounded reading pretty much captures 99% of my view on the topic.

This page is accessible through http://bit.ly/angular-just-say-no and http://bit.ly/angularjustsayno, btw.

View .eslintrc
{
"extends": "standard",
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"env": {
"browser": true,
"node": true
},
View Base16Oceanic Xresources
*foreground: #999697
*background: #1b1b1b
! black
*color0: #1b1b1b
*color8: #444444
! red
*color1: #683e3e
*color9: #7b4e50
View projectSetup
Open terminal => CTRL+ALT+T
Make a folder for your project
1. mkdir project
2. cd project
3. npm init
=> fill out all the needed stuff; name, description, whatever
View IDEA linux font fix
# eg Webstorm bin/webstorm64.vmoptions
-Dswing.aatext=true
-Dawt.useSystemAAFontSettings=gasp
-Dsun.java2d.xrender=true
-Dawt.useSystemAAFontSettings=on
View fullcal_dir
"use strict";
angular.module("Main").directive("activitycalendar", function () {
return {
link: function (scope, elm) {
var $el = angular.element(elm);
function refreshCalendar() {
var curCalView = $el.fullCalendar("getView");
var moment = null;