Skip to content

Instantly share code, notes, and snippets.

View digiltd's full-sized avatar

Sam Turner digiltd

View GitHub Profile
@digiltd
digiltd / transaction-email-variables
Created January 3, 2023 15:26 — forked from tiagones/transaction-email-variables
Magento - Transaction Email Variables
Para a inscrição:
1. {{var customer}} irá imprimir todas as informações do cliente
2. {{var customer.ID}}
3. {{var customer.email}}
4. {{var customer.firstname}}
5. {{var customer.lastname}}
6. {{var customer.name}}
7. {{var customer.password}}
8. {{var customer.created_in}}
@digiltd
digiltd / gist:b7934d8dbf4cbc929b55f7fd7bc0f947
Created January 4, 2018 10:23 — forked from al3xandru/gist:1128606
nvALT Bookmarklet Instapaper
javascript:(function({
var INSTAPAPER=true,w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt="";
tmplt="From ["+pageTitle+"]("+pageUri+"):\n\n";
if(pageSelectedTxt!="") {
pageSelectedTxt=">%20"+pageSelectedTxt;
pageSelectedTxt=pageSelectedTxt.replace(/(\r\n|\n+|\r)/gm,"\n");
pageSelectedTxt=pageSelectedTxt.replace(/\n/g,"\n>%20\n>%20");
w.location.href="nvalt://make/?txt="+encodeURIComponent(tmplt+pageSelectedTxt)+"&title="+encodeURIComponent(pageTitle)
}
else {
@digiltd
digiltd / DragTransform
Created April 26, 2017 10:47 — forked from fta2012/DragTransform
Slightly modified compiled coffeescript from this codepen: http://codepen.io/fta/pen/ifnqH. Paste into console on a page that has jQuery to load the two dependent libraries (jquery-ui and numericjs). Then call makeTransformable('#selector-name') to make that element WYSIWYG editable. Use inspector to get the CSS for the transforms.
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;
@digiltd
digiltd / _underline.scss
Created July 6, 2016 19:18 — forked from pixeline/_underline.scss
Smart Underline Sass Mixin
// dev note: make sure to use an autoprefixer...
@mixin underline($background: #fff, $text: #000, $selection: #ffc, $position: 86%){
color: inherit;
text-decoration: none;
background: linear-gradient($background, $background), linear-gradient($background, $background), linear-gradient($text, $text);
background-size: .05em 1px, .05em 1px, 1px 1px;
background-repeat: no-repeat, no-repeat, repeat-x;
text-shadow: 0.03em 0 $background, -0.03em 0 $background, 0 0.03em $background, 0 -0.03em $background, 0.06em 0 $background, -0.06em 0 $background, 0.09em 0 $background, -0.09em 0 $background, 0.12em 0 $background, -0.12em 0 $background, 0.15em 0 $background, -0.15em 0 $background;
background-position-y: $position,$position, $position;
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Sale!' :
$translated_text = __( 'Clearance!', 'woocommerce' );
@digiltd
digiltd / my.css
Created January 7, 2015 02:19 — forked from anonymous/my.css
background: linear-gradient(270deg, #9c8078, #e2c383, #debd7a, #eab489, #f9ddc6, #eac083, #e6cab2);
background-size: 1400% 1400%;
-webkit-animation: AnimationName 30s ease infinite;
-moz-animation: AnimationName 30s ease infinite;
-o-animation: AnimationName 30s ease infinite;
animation: AnimationName 30s ease infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
@digiltd
digiltd / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/*
// Añadimos un campo llamado user_telephone
- ojo al if(!is_admin )
- ojo en que fichero se meten las líneas de códigon ( tenemos tres ficheros )
- dependencia del plugin Theme My Login
*/

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

<?php
add_filter('gettext', 'rename_admin_menu_items');
add_filter('ngettext', 'rename_admin_menu_items');
/**
* Replaces wp-admin menu item names
*
* @author Daan Kortenbach
*
* @param array $menu The menu array.
*