Skip to content

Instantly share code, notes, and snippets.

View mgmilcher's full-sized avatar

Marius Milcher mgmilcher

View GitHub Profile
@mgmilcher
mgmilcher / gist:5eaed7714d031a12ed97
Last active March 28, 2023 14:53
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

function initLazyImages() {
const lazyImages = document.querySelectorAll(".lazy-image");
function onIntersection(imageEntities) {
imageEntities.forEach(image => {
if (image.isIntersecting) {
observer.unobserve(image.target);
image.target.src = image.target.dataset.src;
}
});
@mgmilcher
mgmilcher / osx-server-aliases
Last active March 18, 2018 16:02
osx-server-aliases
### SERVER SERVICES ALIAS
# Nginx
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
# PHP-FPM
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'
@mgmilcher
mgmilcher / gist:6563332
Created September 14, 2013 16:23
In App Purchasing with Cordova

####Install PhoneGap IAP Plugin

plugman install --platform ios --project [directory] --plugin git://github.com/j3k0/PhoneGap-InAppPurchase-iOS.git

####Add StoreKit framework to XCode project

  1. Go to the Build Phases tab in your project target
  2. Expand the "Link Binary With Libraries" list.
  3. Click the plus button at the button
  4. Search for StoreKit and add the StoreKit.framework item.
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm --install rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum install --enablerepo=rpmforge memcached
memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody
wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar -xvf memcache-2.2.5.tgz
cd memcache-2.2.5
phpize && ./configure --enable-memcache && make
cp /root/memcache-2.2.5/modules/memcache.so /usr/lib/php/modules/
echo extension=memcache.so >> /etc/php.ini
@mgmilcher
mgmilcher / gist:5605936
Created May 18, 2013 22:11
Markdown Cheat Sheet. Originally created by from http://warpedvisions.org/projects/markdown-cheat-sheet/
# Header 1 #
## Header 2 ##
### Header 3 ### (Hashes on right are optional)
#### Header 4 ####
##### Header 5 #####
## Markdown plus h2 with a custom ID ## {#id-goes-here}
[Link back to H2](#id-goes-here)
This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one
@mgmilcher
mgmilcher / linux_crib_sheet.md
Last active October 12, 2015 10:08
Linux Crib Sheet

Linux Shortcuts

General Crib Sheet

Find a file

find / -name php.ini

Find Directory

@mgmilcher
mgmilcher / samples.label
Created October 5, 2012 12:13
SLIMS Sample Label Template
<?xml version="1.0" encoding="utf-8"?>
<DieCutLabel Version="8.0" Units="twips">
<PaperOrientation>Portrait</PaperOrientation>
<Id>Shipping</Id>
<PaperName>30323 Shipping</PaperName>
<DrawCommands>
<RoundRectangle X="0" Y="0" Width="3060" Height="5715" Rx="270" Ry="270" />
</DrawCommands>
<ObjectInfo>
<TextObject>
@mgmilcher
mgmilcher / pagination.ctp
Created June 4, 2012 16:15 — forked from slywalker/pagination.ctp
pagination element for CakePHP on twitter bootstrap
<?php
if (!isset($modules)) {
$modulus = 11;
}
if (!isset($model)) {
$models = ClassRegistry::keys();
$model = Inflector::camelize(current($models));
}
?>
<div class="pagination">