Skip to content

Instantly share code, notes, and snippets.

View xavierartot's full-sized avatar

Xavier Artot xavierartot

  • Paris
View GitHub Profile
@xavierartot
xavierartot / TerminalVim.scpt
Created December 20, 2017 18:42 — forked from charlietran/TerminalVim.scpt
Open file in iTerm vim for MacOS Sierra
-- TerminalVim.app
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as TerminalVim.app in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default
@xavierartot
xavierartot / iterm_nvim.AppleScript
Created December 20, 2017 17:49 — forked from sdkks/iterm_nvim.AppleScript
Open File with iTerm2 + nvim on MAC OSX Sierra
on run {input, parameters}
-- If run without input, open random file at $HOME
try
set filename to POSIX path of input
on error
set filename to "nvim-" & (do shell script "date +%F") & "__" & (random number from 1000 to 9999) & ".txt"
end try
-- Set your editor here
set myEditor to "/usr/local/bin/nvim"
-- Open the file and auto exit after done
#https://gist.github.com/xavierartot/a29b1d65bc81f8e7f3ff8a9958635a72
snippet ri
import ${1:React} from '${0:react}';
snippet ir
import React from 'react';
snippet ird
import ReactDOM from 'react-dom';
snippet rid
import ${1:ReactDOM } from '${0:react-dom}';
snippet cdm
object(SimpleXMLElement)#573 (2) {
["OperationRequest"]=>
object(SimpleXMLElement)#571 (4) {
["HTTPHeaders"]=>
object(SimpleXMLElement)#561 (1) {
["Header"]=>
object(SimpleXMLElement)#558 (1) {
["@attributes"]=>
array(2) {
["Name"]=>
# Functions
# prototype
snippet .
$('.${1:ele}').${0:VISUAL}
snippet proto
${1:class_name}.prototype.${2:method_name} = function(${3}) {
${0:${VISUAL}}
};
# Function
snippet fun
@xavierartot
xavierartot / woocommerce-sage-template-part-overrides.md
Created June 12, 2017 14:01 — forked from drawcard/woocommerce-sage-template-part-overrides.md
Woocommerce - Using template part overrides in Sage

So, you know how to override a template file in Woocommerce using Sage, but you're having trouble changing something within the deeper level of that template file. For example, you want to change the output HTML structure of a given part of the product page loop, or incorporate a Bootstrap class into a button element without using Jquery to inject it. Here's how you can override deeper level parts, the default WC theme elements.

Prerequisites

Now you're familiar with how to do Sage + Woocommerce templates, it's time to make it happen.

The template page override

I taught they used an homemade plugin:
(function($, undefined) {
function resizeLoop(testTag, checkSize) {
var fontSize = 10;
var min = 10;
var max = 0;
var exceeded = false;
for(var i = 0; i < 30; i++) {
testTag.css('font-size', fontSize);
@xavierartot
xavierartot / javacript.snippets
Last active February 4, 2016 22:43
All Snippets for the Snippets javascript
snippet r
return ${1:true};${0}
snippet v
var ${1:variable_name} = ${2:value};${0}
# array
snippet ar
@xavierartot
xavierartot / gist:f8e52adc16b3db2bb442
Last active February 4, 2016 22:10
My TextMate Snippets javascript
###########################################################################
# TextMate Snippets #
Update the plugin bundle/snippets/javascript
###########################################################################
//Add
snippet v "Object Method"
var ${1:variable}= ${0:value};
endsnippet
//border gradient:
.box {
margin: 80px 30px;
width: 200px;
height: 200px;
position: relative;
background: #fff;
float: left;
}
.box:before {