Skip to content

Instantly share code, notes, and snippets.

@imliam
imliam / card-stack.css
Created March 31, 2017 20:06
Card Stack
/*
|--------------------------------------------------------------------------
| Card Stack
|--------------------------------------------------------------------------
|
| Adds a visual effect to make an element looks like there are multiple
| stacks of it. Uses white background and gray border, used for Bootstrap
| 4 cards.
|
*/
@imliam
imliam / data-hover-content.html
Last active March 31, 2017 19:58
jQuery - Hover Content Change
<button class="btn btn-primary" data-hover-content="Goodbye world">
Hello world
</button>
<button class="btn btn-primary" data-hover-element="#elementContent">
Button Content
</button>
<div id="elementContent" style="display:none;">
Element Content
</div>
@imliam
imliam / atelier801.php
Created March 30, 2017 03:04
PHP - Atelier 801 Forum Request
<?php
class atelier801Forums {
public $session, $hiddenKey;
function __construct($user, $pass){
$this->session = new Requests_Session("http://atelier801.com/");
$this->setHeaders();
$this->GET("http://atelier801.com/forums");
$fields = array(
@imliam
imliam / calculate.lua
Created March 29, 2017 22:00
Lua - Recursive Calculation
operation = {4, '+', 6, '-', 2}
function calculate(...)
local tbl={...}
if tbl[2] then
if tbl[2]=='+' then
table.insert(tbl, 1, tbl[1] + tbl[3])
table.remove(tbl, 2)
table.remove(tbl, 3)
table.remove(tbl, 4)
@imliam
imliam / nginx.conf
Created March 21, 2017 09:44
Nginx - Redirect www to non-www
server {
server_name www.yourdomain.com;
return 301 $scheme://yourdomain.com$request_uri;
}
@imliam
imliam / .bash_aliases
Last active October 31, 2017 11:14
Commonly used bash aliases
## Misc. Commands ##
alias h='cd ~'
alias c='clear'
alias ls='ls -alh'
alias pubkey="/bin/cat ~/.ssh/id_rsa.pub | pbcopy"
## A quick way to get out of the current directory ##
alias ..='cd ../'
alias ...='cd ../../'
alias ....='cd ../../../'
@imliam
imliam / web.php
Created March 20, 2017 13:17
Laravel 5 - Route must start with @
<?php
/*
|--------------------------------------------------------------------------
| Laravel 5 - Route must start with @
|--------------------------------------------------------------------------
|
| A quick snippet showing use of the Route::where(); method that lets you
| define a regex pattern for the route to match, such as the "@" symbol
| at the beginning to denote a user.
|
@imliam
imliam / popover-close-when-losing-focus.js
Created March 17, 2017 16:42
Bootstrap 4 - Close Popover When Losing Focus
/*
|--------------------------------------------------------------------------
| Bootstrap 4 - Close Popover When Losing Focus
|--------------------------------------------------------------------------
|
| A JavaScript snippet that closes a Bootstrap 4 popover when clicking off
| of it, but unlike the default behaviour, allows it to stay open when
| clicking within the popover itself.
*/
@imliam
imliam / popover-dom-content.html
Last active May 16, 2022 06:19
Bootstrap 4 - Load Popover Content From DOM
<div id="unique-id" style="display:none;">
<div class="popover-heading">This is a heading</div>
<div class="popover-body">This is HTML content that will be loaded inside a </div>
</div>
<span tabindex="0" role="button" data-toggle="popover" data-placement="bottom" data-popover-content="#unique-id">
Click me to load a popover
</span>
@imliam
imliam / font_awesome_icon_helper.php
Created March 10, 2017 16:06
PHP - Font Awesome Icon Helper
<?php
/*
|--------------------------------------------------------------------------
| PHP - Font Awesome Icon Helper
|--------------------------------------------------------------------------
|
| A helper function to build the HTML for a Font Awesome icon with all of
| the recommended accessibility tags.
|
*/