Skip to content

Instantly share code, notes, and snippets.

View cosmomathieu's full-sized avatar
🎯
Focusing

Cosmo Mathieu cosmomathieu

🎯
Focusing
View GitHub Profile
// Main containers
.container
@include outer-container
// Rows
.row
@include row()
// A basic column without a defined width or height
@cosmomathieu
cosmomathieu / JsonResponse.php
Last active April 24, 2021 16:39
A PHP json object template for dealing with php and ajax form submissions
<?php
/**
* A PHP json object template for dealing with php and ajax form submissions
*
* Provides a framework (for lack of better words) for dealing with ajax
* form submissions. Provides an example of how the php and JavaScript code
* should be formatted.
*
* @author Cosmo Mathieu <cosmo@cosmointeractive.co>
*/
@cosmomathieu
cosmomathieu / MCAPI.class.php
Created May 1, 2017 01:21 — forked from michaelaguiar/MCAPI.class.php
PHP - MailChimp Class API
<?php
class MCAPI {
var $version = "1.3";
var $errorMessage;
var $errorCode;
/**
* Cache the information on the API location on the server
*/
var $apiUrl;
@cosmomathieu
cosmomathieu / CHANGELOG.md
Last active August 22, 2018 14:13 — forked from PurpleBooth/README-Template.md
Templates (README.md, CHANGELOG.md) to make good Git repositories

Changelog

All notable changes to this project will be documented in this file.

[1.0.0]

Added

  • Added new feature, enhencement, or something the-like

Changed

  • Changed something from something to something else
@cosmomathieu
cosmomathieu / index.html
Created October 28, 2017 02:52 — forked from millermedeiros/index.html
Example of how to use a single JS file for multiple pages of an application
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example</title>
<meta name="description" content="This is just an example">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/main.css">
</head>
<body data-modules="foobar, lorem/ipsum">
@cosmomathieu
cosmomathieu / htmlentity.js
Created December 19, 2017 16:38 — forked from CatTail/htmlentity.js
Javascript: encode(decode) html text into html entity
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
@cosmomathieu
cosmomathieu / ps-export-groups-to-files.jsx
Last active March 21, 2019 17:17 — forked from shivanarrthine/ps-export-groups-to-files.jsx
Photoshop script that exports all groups to individual png files. Credits to http://www.damienvanholten.com/blog/export-groups-to-files-photoshop/
#target photoshop
function main() {
if (!documents.length) return;
var doc = activeDocument;
var oldPath = activeDocument.path;
for (var a = 0; a < doc.layerSets.length; a++) {
activeDocument.activeLayer = activeDocument.layers.getByName(doc.layerSets[a].name);
dupLayers();
activeDocument.mergeVisibleLayers();
activeDocument.trim(TrimType.TRANSPARENT, true, true, true, true);
@cosmomathieu
cosmomathieu / jquery.background-image-scroll-effects.js
Last active April 8, 2023 03:08
A lightweight jQuery plugin to animate background images on scroll; fade, zoom, and blur.
/**
* jQuery plugin for adding hero image background animation
*
* Zooms, blurs, and fades background image on scroll down.
*
* @author Cosmo Mathieu <cosmo@cosmointeractive.co>
*/
// jquery-ps-background-animate.js
/*!
@cosmomathieu
cosmomathieu / deploy.sh
Created February 20, 2018 14:38 — forked from sheharyarn/deploy.sh
Static Website Bash Deployment Script
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
__base="$(basename ${__file} .sh)"
@cosmomathieu
cosmomathieu / update-mysql.md
Created February 20, 2018 16:10
Upgrade MySQL 5.5 to 5.7 Ubuntu 16

Upgrade MySQL 5.5 to 5.7 Ubuntu 16

First of all , Backup All your Database.

mysqldump --all-databases > all_databases.sql

Grab the library which contains the 5.7 verson

wget https://dev.mysql.com/get/mysql-apt-config_0.8.9-1_all.deb