Skip to content

Instantly share code, notes, and snippets.

View oquirozm's full-sized avatar
🦕
Front End Dev

Omar Quiroz oquirozm

🦕
Front End Dev
View GitHub Profile
@echo off
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@oquirozm
oquirozm / bootstrap-cdn-fallback.html
Last active January 16, 2016 02:05
Bootstrap + jQuery CDN-Local Fallback
<head>
<!-- Bootstrap CSS CDN -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
</head>
<body>
<!-- APP CONTENT -->
<!-- jQuery CDN -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<!-- jQuery local fallback -->
@oquirozm
oquirozm / wordpress-development.sublime-project
Created January 15, 2016 03:06
Default Sublime Project file for WordPress Theme Development
{
"folders": [
{
"folder_exclude_patterns": [
"wp-includes",
"wp-admin",
"wp-content/plugins",
"wp-content/uploads"
],
"path": "/your/project/path/here",
@oquirozm
oquirozm / gulpfile.js
Last active May 1, 2017 08:38
This is a gulpfile with a very basic setup that includes js and css directories and minifying of both + browsersync live reload.
var gulp = require('gulp');
var bs = require('browser-sync').create();
var gutil = require('gulp-util');
var uglify = require('gulp-uglify');
var cleanCSS = require('gulp-clean-css');
var htmlreplace = require('gulp-html-replace');
var rename = require('gulp-rename');
gulp.task('default', ['compile','browser-sync', 'watch']);
@oquirozm
oquirozm / .gitlab-ci.yml
Created May 18, 2017 10:27
This is a .yml file to setup up ftp deployment in GitLab. Super awesome. Remember to set up the environmental variables.
deploy:
script:
- apt-get update -qq && apt-get install -y -qq lftp
- lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/"
only:
- master
@oquirozm
oquirozm / gulpfile.js
Last active October 10, 2017 22:06
Gulp setup for WordPress Theme Development
// Gulp.js configuration
'use strict';
const
// source and build folders
gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
postcss = require('gulp-postcss'),
deporder = require('gulp-deporder'),
@oquirozm
oquirozm / add_requirejs.php
Created August 10, 2017 01:58
A simple gist that has the code to add requirejs to WordPress.
<?php
// How to add require.js to WordPress.
wp_enqueue_script('requirejs', '//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.15/require.min.js');
$app_base = get_template_directory_uri() . '/scripts';
wp_localize_script( 'requirejs', 'require', array(
'baseUrl' => $app_base,
'deps' => array( $app_base . '/main.js')
));
@oquirozm
oquirozm / composer.json
Created September 9, 2017 05:04
WordPress Plugin composer.json
{
"require": {
"timber/timber": "^1.4",
"webdevstudios/cmb2": "^2.2.5.3"
},
"extra": {
"installer-paths": {
"./vendor/{$name}": ["webdevstudios/cmb2"]
}
}
@oquirozm
oquirozm / media-queries.png
Last active October 9, 2017 04:47
Sass Media Queries Usage
media-queries.png
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 13,
// font family with optional fallbacks