Skip to content

Instantly share code, notes, and snippets.

View n0m4dz's full-sized avatar

Tseegii Tselmeg n0m4dz

View GitHub Profile

Install OS X 10.10 Yosemite in VirtualBox

(based on this pastebin i've found via Google, markdownified and adjusted to work with the official Yosemite release)

Yosemite's first developer preview was released right after Monday's WWDC opening keynote. For the general public, an open beta will be available to download later this summer. However, for those who want a sneak peek at the new hotness, there is a way to safely install it without risking your machine, using the free and powerful VirtualBox application from Oracle.

(LEGAL DISCLAIMER: This guide aims to explain how to create a virtual machine on a regularly purchased Apple computer, running a genuine Mac OS X operating system, for testing purposes only.)

/**
* Created by n0m4dz on 2/06/15.
*/
var gulp = require("gulp"),
bower = require('main-bower-files'),
concat = require("gulp-concat"),
gulpFilter = require("gulp-filter"),
ngAnnotate = require("gulp-ng-annotate"),
uglify = require("gulp-uglify"),
minifycss = require("gulp-minify-css"),
@n0m4dz
n0m4dz / python_pretty_time
Last active October 26, 2018 13:49
python pretty time with localization
# coding: utf-8
from datetime import datetime
from datetime import timedelta
def calc_diff(delta):
delta = abs( delta )
return {
'year' : int(delta.days / 365),
'month' : int(delta.days % 365) / 30,
'day' : int(delta.days % 365) % 30,
@n0m4dz
n0m4dz / LaracasaController.php
Last active August 29, 2015 14:08
Laracasa example
<?php
class LaracasaController extends BaseController
{
public function index() {
$result = Laracasa::getAlbum();
return View::make('picasa')->with('albumFeed', $result);
}
<?php
private $model;
public function __construct()
{
$this->model = new Post;
}
public function getPosts($myCache) {
@n0m4dz
n0m4dz / active_nav.coffee
Last active August 29, 2015 14:07
Angular current navigation highlight
'use strict'
app = angular.module 'app', []
app.run(($scope, $location)->
$scope.isActive = (path)->
if ($location.path().substr(0, path.length) is path)
if (path is "/" && $location.path() is "/")
return true
if (path is "/")
return false
@n0m4dz
n0m4dz / app.coffee
Last active August 29, 2015 14:06
Angular + Laravel main module
'use strict'
$injector = angular.injector(['ng'])
$injector.invoke(($http, $rootScope, $log)->
$rootScope.$apply(->
$http.get("/api/server")
.then((o)->
app = angular.module 'app', []
app.constant 'CONFIGS',