Skip to content

Instantly share code, notes, and snippets.

View bramus's full-sized avatar

Bramus bramus

View GitHub Profile
@xavez
xavez / backup.mysql.local.sh
Last active December 30, 2015 13:59
Backup local mysql databases. Symlink to latest backup. Run with launchd or cron at regular intervals.
#!/bin/bash
# Path to where you want to backup mysql databases.
opath=/Users/username/Sites/Backups/mysql/
# Local mysql details. Make a username with only read access. Allow SELECT, LOCK TABLES.
mysqlhost=127.0.0.1
username=read_only_user
password=read_only_password
@Inferis
Inferis / CommonMacros.h
Last active February 5, 2018 03:01
Common Macros for Xcode projects.
//
// CommonMacros.h
// Created by Tom Adriaenssen (@inferis)
// Inspired by the awesome work by Piet Jaspers (@pjaspers)
//
/*
* How to use this file:
* 1. Find your .pch file
* 2. Import this file
@jedi4ever
jedi4ever / patrick-unomaly.md
Last active February 22, 2019 09:40
Impression of 1 week exchange

I had a long overdue holiday planned. For many people this would mean going somewhere and relax. Turns out I'm not the sight-seeing person , I'm more of a people-seeing person: talking to people and exchanging new ideas is what makes me tick. Having been a consultant for several years, you learn the most from new environments. Interns would have that opportunity to apply , but why can't people with more experience?

So I launched on twitter the idea of what company is willing to do an exchange. After receiving several replies I got invited by Ramon Van Alteren from Unomaly and deciced to take a leap of faith.

It felt like the excitement of starting a new job. Scary , because you don't know what to expect.

@mwbrooks
mwbrooks / style.css
Created February 23, 2011 18:50
Remove Tap Highlight from Mobile Webkit
* {
-webkit-touch-callout:none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust:none; /* prevent webkit from resizing text to fit */
-webkit-tap-highlight-color:rgba(0,0,0,0); /* prevent tap highlight color / shadow */
-webkit-user-select:none; /* prevent copy paste, to allow, change 'none' to 'text' */
}
# info: http://it.dennyhalim.com/2009/10/perfect-mysql-backup.html
/bak/mysql/*/*.sql.gz {
daily
rotate 5
nocompress
postrotate
export HOME=/root
for i in `mysql --batch -e 'show databases' | tail -n +2`; do
if [ ! -e /bak/mysql/$i ]; then mkdir -m 700 /bak/mysql/$i; fi
@NielsLeenheer
NielsLeenheer / Samsung Browser
Last active June 23, 2020 11:33
Samsung Browser
Note: Some older devices such as the Galaxy S III did not get the Chromium based browser with
the update to Android 4.2 or later. When Samsung later introduced the Galaxy S3 Neo it did get
the new browser.
Note: With the Android 4.3 release and version 1.5 of the Chromium browser, Samsung did not
enable WebAudio API for the Note 3. All other devices did get the WebAudio API.
Note: Samsung did not update the browser version with the upgrade from Android 4.3 to 4.4,
but did add getUserMedia and WebRTC functionality.
@colllin
colllin / _affixWithinContainer.md
Last active November 29, 2020 17:13
ion-list sticky headers

What this does:

Within an <ion-scroll>, this directive creates sticky item headers that get bumped out of the way by the next item.

Demo: http://cl.ly/2u2X390s0H1a

Requirements:

  • Needs UnderscoreJS for its _.throttle utility.
  • Must be used within an or
@schmurfy
schmurfy / gist:3199254
Created July 29, 2012 14:33
Install pandoc Mac OS X 10.8
# Install MacTex: http://mirror.ctan.org/systems/mac/mactex/mactex-basic.pkg
$ sudo chown -R `whoami` /usr/local/texlive
$ tlmgr update --self
$ tlmgr install ucs
$ tlmgr install etoolbox
# Install pandoc view homebrew
@adisuryadi
adisuryadi / compile.sh
Last active November 28, 2021 00:16
Run ES6/ES2016/ES2017 in Coderunner (using babel)
#!/bin/bash
#
# This script will transplie our code using babel and evaluates it using node.js
#
# Steps:
# 1) Install babel globally:
# npm install -g babel-cli
# or
# yarn global add babel-cli
# 2) Create a new language in Coderunner preferences (eg. Javascript (Babel)).
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a