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
@kkemple
kkemple / fontStacks.css
Last active January 24, 2019 12:56
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 */
@galderz
galderz / clean-install-high-sierra-apfs.md
Last active July 3, 2019 21:11
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.
@flackjap
flackjap / object-watch.js
Last active November 8, 2019 06:40 — forked from eligrey/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
@bitjockey42
bitjockey42 / 00_OSX_Docker_Machine_Setup.md
Last active November 9, 2020 13:49 — forked from andystanton/Start up local Docker Machine on OSX automatically.md
Use native virtualization on OS X docker with xhyve

What this?

So one of the painful points of using docker on OS X is that you need to run a virtualbox VM, which often suffers from performance issues. With xhyve, a OS X virtualization system, and docker-machine-xhyve you can now have docker use the native OS X hypervisor to run containers.

No more dealing with virtualbox shenanigans!

In this script, I've also set up a way to autoconfigure terminal sessions to load docker's environment vars (dependent on docker-machine) so you do not have to run eval $(docker-machine env whatever) every time you open a new terminal window.

Requirements

@jasondmoss
jasondmoss / stripNamespaceFromClassName.php
Last active February 18, 2021 00:06
Strip the namespace from the class to get the actual class name
<?php
/**
* Strip the namespace from the class to get the actual class name
*
* @param string $obj Class name with full namespace
*
* @return string
* @access public
*/
@cronfy
cronfy / .htaccess
Last active July 23, 2021 19:44 — forked from donnykurnia/.htaccess
.htaccess 503 Техническое обслуживание сайта (maintenance page)
AddDefaultCharset utf-8
ErrorDocument 503 /maintenance.html
RewriteEngine On
RewriteBase /
# uncomment and set your ip to allow your ip to enter
#RewriteCond %{REMOTE_ADDR} !1\.2\.3\.4
# block requests to site, but allow let's encypt generation

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new phx.new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
@donnykurnia
donnykurnia / .htaccess
Created April 1, 2013 08:52
.htaccess for 503 maintenance page
ErrorDocument 503 /index.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.html [R=503,L]
@alphp
alphp / cif_validation.php
Last active May 12, 2022 08:53
Spanish CIF validation (PHP)
<?php
function cif_validation ($cif) {
$cif = strtoupper($cif);
if (preg_match('~(^[XYZ\d]\d{7})([TRWAGMYFPDXBNJZSQVHLCKE]$)~', $cif, $parts)) {
$control = 'TRWAGMYFPDXBNJZSQVHLCKE';
$nie = array('X', 'Y', 'Z');
$parts[1] = str_replace(array_values($nie), array_keys($nie), $parts[1]);
$cheksum = substr($control, $parts[1] % 23, 1);
return ($parts[2] == $cheksum);
} elseif (preg_match('~(^[ABCDEFGHIJKLMUV])(\d{7})(\d$)~', $cif, $parts)) {
@nathanl
nathanl / postgresql_serializable_isolation.sql
Last active July 15, 2022 14:11
PostgreSQL Serializable Isolation - false positives
-- (This code was run in PostgreSQL 9.6.1)
-- Demonstration of how serializable isolation for PostgreSQL, which detects possible
-- interference between concurrent transactions, can produce false positives
-- in psql, create the following table
CREATE TABLE users(
id SERIAL NOT NULL PRIMARY KEY,
username VARCHAR NOT NULL
);