Skip to content

Instantly share code, notes, and snippets.

View imarkdesigns's full-sized avatar

Mark Joseph Rivera imarkdesigns

View GitHub Profile
@imarkdesigns
imarkdesigns / app.php
Created April 30, 2018 12:52
A PHP 7.1 Encrypter for Laravel 4.2 #laravel
<?php
// Add service provider
// Add the following to your providers in the app config
\Tomgrohl\Laravel\Encryption\EncryptionServiceProvider::class
// Check Encryption Key settings in app config
// Cipher must either be ‘AES-128-CBC’ with a key length of 16
// OR
// Cipher must either be ‘AES-256-CBC’ with a key length of 32
@imarkdesigns
imarkdesigns / download.php
Created March 31, 2018 02:02
Force Download #jquery
<p>The download should start shortly. If it doesn't, click
<a data-auto-download href="/your/file/url">here</a>.</p>
@imarkdesigns
imarkdesigns / semantic-layout.html
Created March 22, 2018 08:56 — forked from thomd/semantic-layout.html
Standard HTML5 Semantic Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="stylesheets/main.css" rel="stylesheet" />
</head>
<body>
<header>
<hgroup>
@imarkdesigns
imarkdesigns / accordion.js
Created February 16, 2018 06:28
Uikit 3 Accordion + ScrollTo #uikit #jquery
// Script originally made by @zzseba78
// Using JQuery
var $ac = $('#accordion');
UIkit.accordion($ac, {
multiple: false,
collapsible: true,
duration: 300,
transition:"easeInOut"
});
$('a.uk-accordion-title').on('click', function() {
<script>
jQuery( document ).ready(function() {
jQuery(".et_bloom_submit_subscription").click(function(){
var form = jQuery(this).parent(), error = 0;
var name_val = form.find(".et_bloom_subscribe_name input").val();
if(name_val.trim() == '') {
form.find(".et_bloom_subscribe_name input").addClass('et_bloom_warn_field');
error = 1;
@imarkdesigns
imarkdesigns / disclaimer.js
Created January 3, 2018 09:37
Uikit 3 Modal popup using JSCookie #javascript #uikit
<script>
"use strict";
!(function($) {
$.getScript('https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.2.0/js.cookie.min.js', function() {
var visits = Cookies.set('visits') || 0;
visits++;
Cookies.set('visits', visits, { expires: 1, path: '/' });
@imarkdesigns
imarkdesigns / sass-fig1.scss
Created December 24, 2017 21:06
SaSS using @each loop and list #sass
$colors-list: #3b5999 #55acee #e4405f #cd201f #dd4b39;
@each $bg-color in $colors-list {
$i: index($colors-list, $bg-color);
li:not(:last-child):nth-child(#{$i}) a {
background: $bg-color;
@include square(32px);
}
}
@imarkdesigns
imarkdesigns / file-page.php
Created December 18, 2017 11:30
Bootstrap Modal with setTimeout() #jquery #bootstrap
<script>
$(window).load(function(){
setTimeout(function(){
$('#myModal').modal('show');
}, 5000);
});
</script>
@imarkdesigns
imarkdesigns / terminal
Last active March 21, 2018 01:55
Allow Apps from Anywhere bypass code #terminal
sudo spctl --master-disable
@imarkdesigns
imarkdesigns / primary_category.php
Created December 4, 2017 01:47 — forked from danieljwonder/primary_category.php
Display Primary Category (Yoast's WordPress SEO)
<?php
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY
$category = get_the_category();
$useCatLink = true;
// If post has a category assigned.
if ($category){
$category_display = '';
$category_link = '';
if ( class_exists('WPSEO_Primary_Term') )