Skip to content

Instantly share code, notes, and snippets.

View isellsoap's full-sized avatar

Francesco Schwarz isellsoap

View GitHub Profile
@kitloong
kitloong / mac-homebrew-lamp.md
Last active April 27, 2024 06:56
Mac - Install Apache, PHP, MySQL + phpMyAdmin with Homebrew

!!! This guide was created with Macbook Pro M1. Path may vary for different or even same machine.

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install PHP

@kaishin-r
kaishin-r / sublime-text-3-cloud-drive-sync
Created February 19, 2016 09:48
Sync Sublime Text 3 Settings via iCloud Drive
# Create a directory named "Sublime Text 3 Sync" under iCloud Drive
mkdir ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync
# Enter Sublime Text 3's directory
cd ~/Library/Application\ Support/Sublime\ Text\ 3/
# Move "Installed Packages" directory to iCloud Drive and make a link
mv Installed\ Packages/ ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync/
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync/Installed\ Packages
# The packages we'll be using
packages <- c("rvest","dplyr","tidyr","pipeR","ggplot2","stringr","data.table")
# From those packages, which ones are not yet installed?
newPackages <- packages[!(packages %in% as.character(installed.packages()[,"Package"]))]
# If any weren't already installed, install them now
if(length(newPackages)) install.packages(newPackages)
# Now make sure all necessary packages are loaded
@mathiasbynens
mathiasbynens / web-platform-status-links.md
Last active April 16, 2024 02:54
Web platform status links
@adactio
adactio / micropub.php
Last active January 20, 2023 16:09
Minimal micropub endpoint.
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
$mysite = 'https://adactio.com/'; // Change this to your website.
$token_endpoint = 'https://tokens.indieauth.com/token';
$_HEADERS = array();
foreach(getallheaders() as $name => $value) {
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@hdragomir
hdragomir / sm-annotated.html
Last active March 5, 2024 08:57
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@anselmh
anselmh / target_blank--external.js
Created July 24, 2013 12:12
Open all external links (different hostname than current page) in new tab/window with plain vanilla JavaScript.
/**
* Open external links in new tab/window
*/
// All http:// links should open in new tab/window. Internal links are relative.
var anchors = document.querySelectorAll('a');
for (var i = 0; i < anchors.length; i++) {
if (anchors[i].host !== window.location.hostname) {
anchors[i].setAttribute('target', '_blank');
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 30, 2024 04:42
A badass list of frontend development resources I collected over time.