Skip to content

Instantly share code, notes, and snippets.

View licvido's full-sized avatar

Filip Mikovcak licvido

View GitHub Profile
@licvido
licvido / RBResizer.swift
Last active September 18, 2023 11:36 — forked from HamptonMakes/RBResizer.swift
SWIFT: Crop image to square (& resize)
//
// RBResizer.swift
// Locker
//
// Created by Hampton Catlin on 6/20/14.
// Copyright (c) 2014 rarebit. All rights reserved.
//
import UIKit
@licvido
licvido / app.swift
Last active September 18, 2015 06:02
SWIFT: Button with border
button.backgroundColor = UIColor.clearColor()
button.layer.cornerRadius = 5
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.whiteColor().CGColor

Free disk space when /boot is full (Ubuntu)

TL;DR

dpkg -l linux-image*
uname -r
sudo apt-get remove linux-image-2.6.32-{21,37,38,39,40,41,42,43,44}-server
sudo apt-get autoremove
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
<?php
require 'nette.phar';
//Tracy\Debugger::enable();
$dns = "mysql:host=localhost;dbname=database";
$user = "user";
$password = "*****";
@licvido
licvido / terminal.sh
Created September 8, 2015 14:10
OSX: Kill all Simulator processes
killall "iOS Simulator"
@licvido
licvido / app.swift
Created September 11, 2015 14:04
SWIFT: Singleton
class DeathStarSuperlaser {
static let sharedInstance = DeathStarSuperlaser()
private init() {
// Private initialization to ensure just one instance is created.
}
}
let laser = DeathStarSuperlaser.sharedInstance
@licvido
licvido / database.php
Last active January 15, 2016 17:44
NETTE: Database connection sample
<?php
require 'nette.phar';
Tracy\Debugger::enable();
$dsn = "mysql:host=localhost;dbname=database";
$user = "root";
$password = "***";
@licvido
licvido / app.swift
Last active October 3, 2015 18:25
SWIFT: Hide separator line from from empty cells
/*
* DEMO - https://github.com/dasdom/TableViewFooterDemo
*/
self.tableView.tableFooterView = UIView(frame: CGRect.zeroRect) // that's it!
@licvido
licvido / git.migrate
Created October 16, 2015 10:26 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.