Skip to content

Instantly share code, notes, and snippets.

View asaelx's full-sized avatar

Asael Jaimes asaelx

  • Monterrey, México
View GitHub Profile
@asaelx
asaelx / keyboard_us_intl
Created July 23, 2020 22:04
Set Keyboard Layout us intl in Archlinux
setxkbmap -layout us -variant intl
@asaelx
asaelx / SessionTimeout.php
Last active February 4, 2016 05:55
This Middleware made it super easy to satisfy a requirement to log the user out after 15 minutes of in activity.
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
use Illuminate\Session\Store;
class SessionTimeout {
protected $session;
protected $timeout=900;
public function __construct(Store $session){
$this->session=$session;
}
Blade::extend(function($value) {
return preg_replace('/\@set(.+)/', '<?php ${1} ?>', $value);
});
// Example
// @set $var = 'foo'
@asaelx
asaelx / _grid.sass
Last active January 12, 2016 04:06
$columns: 12
$gutter: 0
$max-width: 100%
=breakpoint($size)
@media only screen and ($size)
@content
*, *:after, *:before
margin: 0
/* Reset */
*, *:before, *:after
margin: 0
padding: 0
outline: 0
box-sizing: border-box
html,
body
height: 100%
@asaelx
asaelx / blade-mixins.jade
Last active December 21, 2015 11:34 — forked from JaminFarr/blade-mixins.pug
Laravel Blade mixins for jade for use with laravel-elixir-jade
//- For use with https://github.com/CREEATION/laravel-elixir-jade
mixin blade()
='\r\n'
block
='\r\n'
mixin phpblock()
!='\r\n<?php '
@asaelx
asaelx / setup.sh
Last active December 19, 2015 08:38
#!/usr/bin/env bash
# # # # # # # # # #
# Developer Stuff #
# # # # # # # # # #
# Install Homebrew
echo "Installing Homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Magento Cheat Sheet

Page path:

<?php echo $this->getUrl('mypage'); ?>

Image path:

<?php echo $this->getSkinUrl('images/button.gif'); ?>
@asaelx
asaelx / vidtogif.sh
Last active August 29, 2015 14:25 — forked from imkevinxu/vidtogif.sh
Convert an animated video to gif from http://chrismessina.me/b/13913393/mov-to-gif
# Convert an animated video to gif
# Works best for videos with low color palettes like Dribbble shots
#
# @param $1 - video file name like `animation.mov`
# @param @optional $2 - resize parameter as widthxheight like `400x300`
#
# Example: vidtogif animation.mov 400x300
# Requirements: ffmpeg and gifsicle. Can be downloaded via homebrew
#
# http://chrismessina.me/b/13913393/mov-to-gif
@asaelx
asaelx / nginx_config
Created July 20, 2015 21:46
Nginx Config for Magento
server {
listen 80;
server_name domain.com www.domain.com;
root /var/www/domain.com;
location / {
index index.html index.php;
## If missing pass the URI to Magento's front handler
try_files $uri $uri/ @handler;