Skip to content

Instantly share code, notes, and snippets.

Avatar

Asael Jaimes asaelx

  • Monterrey, México
View GitHub Profile
@asaelx
asaelx / keyboard_us_intl
Created Jul 23, 2020
Set Keyboard Layout us intl in Archlinux
View keyboard_us_intl
setxkbmap -layout us -variant intl
@asaelx
asaelx / SessionTimeout.php
Last active Feb 4, 2016
This Middleware made it super easy to satisfy a requirement to log the user out after 15 minutes of in activity.
View SessionTimeout.php
<?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;
}
View set_variable_blade.php
Blade::extend(function($value) {
return preg_replace('/\@set(.+)/', '<?php ${1} ?>', $value);
});
// Example
// @set $var = 'foo'
View _grid.sass
$columns: 12
$gutter: 0
$max-width: 100%
=breakpoint($size)
@media only screen and ($size)
@content
*, *:after, *:before
margin: 0
View _reset.sass
/* Reset */
*, *:before, *:after
margin: 0
padding: 0
outline: 0
box-sizing: border-box
html,
body
height: 100%
@asaelx
asaelx / blade-mixins.jade
Last active Dec 21, 2015 — forked from JaminFarr/blade-mixins.pug
Laravel Blade mixins for jade for use with laravel-elixir-jade
View blade-mixins.jade
//- For use with https://github.com/CREEATION/laravel-elixir-jade
mixin blade()
='\r\n'
block
='\r\n'
mixin phpblock()
!='\r\n<?php '
View setup.sh
#!/usr/bin/env bash
# # # # # # # # # #
# Developer Stuff #
# # # # # # # # # #
# Install Homebrew
echo "Installing Homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
View magento-cheatsheet.md

Magento Cheat Sheet

Page path:

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

Image path:

getSkinUrl('images/button.gif'); ?&gt;
@asaelx
asaelx / vidtogif.sh
Last active Aug 29, 2015 — forked from imkevinxu/vidtogif.sh
Convert an animated video to gif from http://chrismessina.me/b/13913393/mov-to-gif
View vidtogif.sh
# 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 Jul 20, 2015
Nginx Config for Magento
View nginx_config
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;