Skip to content

Instantly share code, notes, and snippets.

View nivv's full-sized avatar
💯

Albin N nivv

💯
  • Karabin AB
  • Sweden
  • 21:32 (UTC +02:00)
View GitHub Profile
@nivv
nivv / ImagesController.php
Last active January 24, 2016 08:58
Check if relation exists
<?php
namespace App\Http\Controllers\Api;
use App\Image;
use App\Article;
use App\Http\Requests;
use Illuminate\Http\Request;
use App\Transformers\ImageTransformer;
use App\Http\Controllers\Api\ApiController;
<?php
class ArticlesController extends ApiController
{
// Like this
/**
* Store a newly created resource in storage.
*
* @param \App\Http\Requests\CreateArticleRequest $request
@nivv
nivv / converted.md
Created January 8, 2016 16:22
petstore

FORMAT: 1A HOST: http://petstore.swagger.io/v2

Swagger Petstore

This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key to test the authorization filters.

Authentication

This API uses OAuth v2 Bearer Token for its authentication.

Group pet

@nivv
nivv / nivv.zsh-theme
Created January 5, 2016 18:09
Oh my zsh - theme
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/
# Mar 2013 ys
# Machine name.
function box_name {
@nivv
nivv / dd.php
Last active December 22, 2015 11:07
<?php
class thingy {
/**
* Initiate the crawl
* @param string $url
*/
public function traverse($url = null)
{
if ($url === null) {
@nivv
nivv / PHP 7 - Installing imagick on Ubuntu 14.04.md
Last active November 28, 2021 11:38
Guide - Enable imagick on PHP7

Guide

Note The extension Imagick is now included in Ondrej's PPA. All you need to do now is $ sudo apt-get install php-imagick, and you're done. I'll keep the guide here because a lot of it is still true for other extensions

======

I've installed PHP7 via Ondrej's PPA. He maintains these PPA's on his free time, consider donating

Install dependencies

// I have two objects that contains the same type of objects. But how can I sync them?
// For instance, if the name changes in any of the objects I want the other array
// to be udpdated with the new value. Is this possible?
"images": [
{
"id": 38,
"name": "IFK 2015.png",
"path": "uploads/images/IFK 2015.png",
},
var elixir = require('laravel-elixir');
require('laravel-elixir-imagemin');
elixir.config.js.browserify.transformers.push({
name: 'vueify'
});
elixir.config.js.browserify.transformers.push({
name: 'babelify',
options: {stage: 0}
/** @jsx React.DOM */
var React = require('react/addons');
var Timer = React.createFactory(require('./Timer.js').Timer);
var ReactApp = React.createClass({
componentDidMount: function () {
console.log(fakeData);
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa