Skip to content

Instantly share code, notes, and snippets.

View inoas's full-sized avatar
🏠
Working from home

inoas

🏠
Working from home
View GitHub Profile
@inoas
inoas / Git checkout remote branch
Created November 10, 2016 14:45 — forked from markSci5/Git checkout remote branch
Git checkout remote branch
//To fetch a branch, you simply need to:
git fetch origin
//This will fetch all of the remote branches for you. With the remote branches
//in hand, you now need to check out the branch you are interested in, giving
//you a local working copy:
git checkout -b test origin/test
@inoas
inoas / PHPtoICS.php
Created January 9, 2017 16:30 — forked from jakebellacera/ICS.php
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
// Variables used in this script:
// $summary - text title of the event
// $datestart - the starting date (in seconds since unix epoch)
// $dateend - the ending date (in seconds since unix epoch)
// $address - the event's address
// $uri - the URL of the event (add http://)
// $description - text description of the event
// $filename - the name of this file for saving (e.g. my-event-name.ics)
//
<?php
$xmlView = new XmlView;
$xmlView->templatePath = 'Service';
$xmlView->template = 'api.xml'; // Template/Service/xml/api.xml.ctp
$xmlView->set('foo', 'bar');
var_dump($xmlView->render());
@inoas
inoas / IsUniqueInContext.php
Created March 8, 2017 15:10
CakePHP3 IsUniqueInContextRule
<?php
namespace App\Model\Rule;
use Cake\Datasource\EntityInterface;
use Cake\ORM\TableRegistry;
/**
* Checks if a list of fields from an entity are unique in the table given a context where they can be duplicates
*/
class IsUniqueInContext
@inoas
inoas / brew-perms.sh
Created June 30, 2017 22:58 — forked from jaibeee/brew-perms.sh
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@inoas
inoas / .eslintrc.js
Created September 1, 2017 16:44 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@inoas
inoas / fontStacks.css
Created November 23, 2017 19:22 — forked from kkemple/fontStacks.css
Font Stacks with all browser based fonts
/* Times New Roman-based stack */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* Modern Georgia-based serif stack */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
/* Traditional Garamond-based serif stack */
font-family: "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif;
/* Helvetica/Arial-based sans serif stack */
@inoas
inoas / .htaccess
Created December 4, 2017 23:28 — forked from ludo237/.htaccess
The ultimate .htaccess file. Please feel free to fork it, edit it and let me know what do you think about it.
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
# This is the free sample of .htaccess from 6GO s.r.l.
# @author Claudio Ludovico Panetta (@Ludo237)
@inoas
inoas / clean-install-high-sierra-apfs.md
Created December 21, 2017 18:50 — forked from galderz/clean-install-high-sierra-apfs.md
How To Clean Install High Sierra on APFS-formatted main HD

Clean Install High Sierra on APFS-formatted main HD

Installation Steps

  1. From 10.11 or 10.12 systems, format an external hard drive with at least 500gb with "Mac Os Extended Journaled".
  2. Download High Sierra Beta and install it in the external hard drive.
  3. When the system reboots and finishes installation, it will boot from the external HD. Go to Preferences and change Startup Disk to be main HD.
  4. Reboot and press Option key when the computer makes a beep and select external HD to boot from it.
  5. Once booted again into external HD, format main HD to be APFS.
@inoas
inoas / object-watch.js
Created January 16, 2018 09:53 — forked from flackjap/object-watch.js
Fork of object.watch polyfill in ES5. Modified to not react when the value set is the same as previous.
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
*
* Modified by Nenad Damnjanović
* Nov 9, 2014