Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / flip.css
Created April 5, 2017 16:37
Flip an Element
/* entire container, keeps perspective */
.flip-container {
perspective: 1000px;
}
/* flip speed goes here */
.flipper {
transition: 0.6s;
transform-style: preserve-3d;
@imliam
imliam / hamburger-spin.scss
Created April 5, 2017 16:43
Bootstrap 4 - Animated Hamburger Icon
// Additional spin to the animation.
.hamburger {
display: inline-block;
width: 1.5em;
height: 1.5em;
padding-top: 0.3em;
padding-bottom: 0.3em;
vertical-align: middle;
@imliam
imliam / nav.css
Created April 6, 2017 07:52
Bootstrap 4 - Navbar Hover Effects
.circleBehind a, .brackets a, .pullDown a, .pullUp a, .pullUpDown a
{
text-decoration: none;
position: relative;
z-index: 0;
cursor: pointer;
}
/* Circle behind */
.circleBehind a:before, .circleBehind a:after
@imliam
imliam / cmd.lua
Created April 26, 2017 16:01
Command line argument parsing
command_strings = {
'php artisan make="hi mate" heh "I have a value"',
"php artisan make:auth",
[[I "am" 'the text' and "some more text with '" and "escaped \" text"]],
[[1 2 word 2 9 'more words' 1 "and more" "1 2 34"]],
[[omo "This is a string!" size=14 font="Comic Sans" break= hmm "thing and 'thing'" ]]
}
function command_parse(s)
local t={}
@imliam
imliam / skill-charging.lua
Created May 7, 2017 02:24
Transformice Skill Charging
-- List of keycodes
keys = {
['LEFT'] = 0,
['UP'] = 1,
['RIGHT'] = 2,
['DOWN'] = 3,
['BACKSPACE'] = 8,
['SHIFT'] = 16,
['CTRL'] = 17,
['ALT'] = 18,
local inspect ={
_VERSION = 'inspect.lua 3.1.0',
_URL = 'http://github.com/kikito/inspect.lua',
_DESCRIPTION = 'human-readable representations of tables',
_LICENSE = [[
MIT LICENSE
Copyright (c) 2013 Enrique García Cota
Permission is hereby granted, free of charge, to any person obtaining a