Skip to content

Instantly share code, notes, and snippets.

View imrvelj's full-sized avatar
Undefined is not a function

Ivan Mrvelj imrvelj

Undefined is not a function
View GitHub Profile
@imrvelj
imrvelj / README.md
Created January 19, 2017 10:20 — forked from tjamps/README.md
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

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 :

$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 / markdown.md
Created February 22, 2017 14:20 — forked from rikukissa/POST.md
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom

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)
@imrvelj
imrvelj / .babelrc
Created March 20, 2017 14:44 — forked from JamieMason/.babelrc
Tree-Shaking with Babel 6, Webpack 2, and React.
{
"presets": [
["es2015", {
"es2015": {
"loose": true,
"modules": false
}
}], "react"
]
}
https://bks8e8d1i9x4w4ks.v1.p.beameio.net
export LD_PRELOAD="libpthread.so.0 libGL.so.1" /
export __GL_THREADED_OPTIMISATIONS=1 /
export __GL_SYNC_TO_VBLANK=0 /
export __GL_YIELD=USLEEP

Problem

In Arch Linux mkinitcpio -p linux

shows

Possibly missing firmware for module: aic94xx
 Possibly missing firmware for module: wd719x
@imrvelj
imrvelj / arch-linux-install
Created May 24, 2017 09:16 — forked from binaerbaum/arch-linux-install
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swiss-french keymap
When returned from a TransitionHookFn or TransitionStateHookFn, these values alter the running Transition:
False: the transition will be cancelled.
TargetState: the transition will be redirected to the new target state.
Promise: the transition will wait for the promise to resolve or reject. (see below)
If the promise is rejected (or resolves to false), the transition will be cancelled
If the promise resolves to a TargetState, the transition will be redirected
If the promise resolves to anything else, the transition will resume
Anything else: the transition will resume
Los Brito - El 4 5 6 ( watch?v=P2vDc7WxFs0 )
Skitz Ft. Buggsy - Born Inna System
Chick Corea and Gary Burton - Crystal Silence ( watch?v=p99xxR_2FdY )
PLUSTWO - Stop fantasy (1983)
DRS - This Ain't Love feat Calibre [Official Video]
OSHUN - Sango
Children Of Zeus - Still Standing (feat. DRS) (Lenzman Remix) (Official Video)
L' Entourloop - Time to Grow (feat. Gavlyn)
Archy Marshall - The Sea Liner MK 1
Little Richard - Hurry Sundown