We follow a Gitflow workflow
If you do not have direct write access, please fork this repository.
When you are happy with your changes, submit a pull request for code review.
We follow a Gitflow workflow
If you do not have direct write access, please fork this repository.
When you are happy with your changes, submit a pull request for code review.
# | |
# Standard Doubtfire Overcommit Config | |
# See https://gist.github.com/alexcu/6e05d64d04b32bb42b4d | |
# | |
CommitMsg: | |
ALL: | |
on_warn: fail | |
EmptyMessage: | |
enabled: true | |
MessageFormat: |
-- | |
-- Implements phishing suggestions by Apple | |
-- http://www.apple.com/legal/more-resources/phishing/ | |
-- | |
using terms from application "Mail" | |
-- Strip the domain from an email address | |
on domainOf(address) | |
set atIndex to offset of "@" in address | |
set domain to strings (atIndex + 1) thru -1 of address | |
return domain |
// Only import only funcs and structs we need to use | |
#if os(Linux) | |
// Linux uses Glibc | |
import struct Glibc.FILE | |
import func Glibc.fopen | |
import func Glibc.fgets | |
import func Glibc.fclose | |
#else | |
// OS X uses Darwin | |
import struct Darwin.C.FILE |
(function(){var s=document.createElement('script');s.src='https://gist.githubusercontent.com/alexcu/9204ea1c7ccfa4e42d443ab35f3d406e/raw/b11a51f15a7656b8746000616435ae779a5d21ed/put.js';document.body.appendChild(s);})(); |
function ajax(url, callback, data, x) { | |
try { | |
x = new(this.XMLHttpRequest || ActiveXObject)('MSXML2.XMLHTTP.3.0') | |
x.open(data ? 'POST' : 'GET', url, 1) | |
x.setRequestHeader('X-Requested-With', 'XMLHttpRequest') | |
x.setRequestHeader('Content-type', 'application/json') | |
x.onreadystatechange = function () { | |
x.readyState > 3 && callback && callback(x.responseText, x) | |
} | |
x.send(JSON.stringify(data)) |
# Gets the macOS major/minor versions | |
mac_os_major_version=$(sw_vers | grep "ProductVersion:" | sed -e 's/.*10\.\([0-9][0-9]\).*/\1/') | |
mac_os_minor_version=$(sw_vers | grep "ProductVersion:" | sed -e 's/.*10\.[0-9][0-9]\(.*\)/\1/') | |
# macOS Sierra 10.12.2 requires extra config in .ssh/config | |
# See https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ | |
if [ $((mac_os_major_version)) -gt 12 ] || | |
([ $((mac_os_major_version)) -eq 12 ] && [ $((mac_os_minor_version)) -ge 0.2 ]); then | |
cat << EOF >> ~/.ssh/config | |
Host * |
sed -i -e 's/home:/home:windows /g' /etc/nsswitch.conf |
// ============================ | |
// = User Input Function in C = | |
// ============================ | |
#include <stdio.h> | |
// | |
// The my_string type can be used to represent a "string" in C. | |
// This needs to be a struct so that it can be returned from |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef enum supermarket_t { | |
COLES, WOOLIES, ALDI | |
} supermarket_t; | |
typedef struct product_t { | |
char *name; | |
float price; |