Skip to content

Instantly share code, notes, and snippets.

View oliveratgithub's full-sized avatar

Oliver oliveratgithub

View GitHub Profile
@Irvyne
Irvyne / php-mamp-cli-with-alias.md
Last active August 24, 2020 01:47
Use mamp php in cli (using an alias)

Use mamp php in cli (using an alias)

Open a terminal and type php -v to see the current version of php.

Determine the path for the wanted php version of mamp (YOUR VERSION ON YOUR COMPUTER!)

  • example : /Applications/MAMP/bin/php/php5.x.x/bin/php

Type in the terminal cd ~ to change the current directory (in your home)

@oliveratgithub
oliveratgithub / mamp-sql-dump-export.sh
Created January 6, 2017 20:42
MAMP MySQL dump export using Terminal.app in macOS
$ cd /Applications/MAMP/Library/bin/
$ ./mysqldump --host=localhost -uroot -proot source_database > ~/Desktop/database_name-dump.sql
@Swiss-Mac-User
Swiss-Mac-User / mysql57_convert_datetime_null.sql
Created March 23, 2021 20:19
MySQL 5.7 set datetime or date to NULL from 0000-00-00 00:00:00 - Fixes incorrect datetime value: '0000-00-00 00:00:00' (without NO_ZERO_DATE workaround)
/** ---
* To set an existing column in MySQL 5.7 from 0000-00-00 00:00:00 to NULL as default
* the following iterative 3 steps will get the job done.
* (Without just using the NO_ZERO_DATE compatibility mode-workaround)
--- */
/* Step 1) Set all 0000-00-00... to a valid but nonsense value: */
UPDATE my_table SET my_datetime_col = '1001-01-01 00:00:00' WHERE CAST(my_datetime_col AS CHAR(20)) = '0000-00-00 00:00:00';
/* Step 2) Modify the column to DEFAULT: NULL */
@hermanussen
hermanussen / SitecoreChecks.aspx
Created October 3, 2015 14:37
This is a simple page that can be dropped into a Sitecore CM or CD server so you can easily monitor its health.
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="Sitecore.ContentSearch" %>
<%@ Import Namespace="Sitecore.Data" %>
<%@ Import Namespace="Sitecore.Data.Items" %>
<script runat="server">
#region Configure actual checks here
@jpwright
jpwright / csstwitterbutton.html
Created April 8, 2012 20:52
CSS Twitter Button
<!-- This mimics the official tweet buttons that Twitter provides, without using JavaScript. This is useful for certain web applications, and for emails. See https://twitter.com/about/resources/buttons -->
<style type="text/css">
.tweetbutton {
inherit: none;
height: 16px;
display: inline-block;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
@oliveratgithub
oliveratgithub / autoexec.cfg
Last active September 11, 2021 09:23
ioQuake3 – custom high definition configurations for best visual quality (Quake 3, Quake III Arena). This config file is featured on https://swissmacuser.ch/how-you-want-to-run-quake-iii-arena-in-2018-with-high-definition-graphics-120-fps-on-5k-resolution/
seta r_mode "-1"
seta r_customwidth "5120"
seta r_customheight "2880"
seta cg_fov "115"
seta cg_gunCorrectFOV "1"
seta cl_renderer "opengl2"
seta r_allowSoftwareGL "0"
seta r_ignoreGLErrors "1"
seta r_smp "1"
seta r_displayrefresh "0"
@clnmcgrw
clnmcgrw / gist:9086505
Last active November 25, 2021 11:16
Google Maps API Geocode Example - PHP/JSON
<?php
// address to map
$map_address = "";
$url = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=".urlencode($map_address);
$lat_long = get_object_vars(json_decode(file_get_contents($url)));
// pick out what we need (lat,lng)
$lat_long = $lat_long['results'][0]->geometry->location->lat . "," . $lat_long['results'][0]->geometry->location->lng;
@joar
joar / README.rst
Last active March 21, 2022 06:30
Using unicode in your SSID on ASUS RT-AC66U, in ASUSWRT

Using unicode in your SSID on ASUS RT-AC66U

Danger

This might void your warranty. Do it on your own risk.

I'm using the 🐟 emoji character as my SSID, because I like to be special.

How I do it

@SimonGivre
SimonGivre / test-country-IP-addresses.txt
Created August 30, 2012 10:21
Test country IP addresses
# IPs
Spain 62.13.255.230 2.20.185.5
Germany 2.16.6.5
Australia 1.2.3.4
USA 65.98.56.219
UAE 80.190.204.129
Italy 87.23.255.254
French 62.129.191.252
UK 91.151.7.6
CZ 62.4.96.5
@lsauer
lsauer / Docker: save_load_compressed_container.bash
Created March 25, 2019 11:37
Docker: save/load container using tgz file (tar.gz)
#for an image ("not running container") use save:
docker save <dockernameortag> | gzip > mycontainer.tgz
#for running or paused docker, use export:
docker export <dockernameortag> | gzip > mycontainer.tgz
#load
gunzip -c mycontainer.tgz | docker load