Skip to content

Instantly share code, notes, and snippets.

@6ui11em
6ui11em / creative-cloud-disable.md
Created December 27, 2022 08:52 — forked from andreibosco/creative-cloud-disable.md
disable creative cloud startup on mac
@6ui11em
6ui11em / Magento 2 - Remove all customer data
Created December 14, 2021 14:26 — forked from rafaelstz/Magento 2 - Remove all customer data
Remove all Magento 2 test Sample Data
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE `customer_entity`;
TRUNCATE TABLE `customer_entity_datetime`;
TRUNCATE TABLE `customer_entity_decimal`;
TRUNCATE TABLE `customer_entity_int`;
TRUNCATE TABLE `customer_entity_text`;
TRUNCATE TABLE `customer_entity_varchar`;
TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
@6ui11em
6ui11em / magento2_live_templates.xml
Last active December 13, 2017 09:50 — forked from cmuench/magento.xml
Magento2 PHPStorm Live Templates #magento2 #phpstorm #snippets #livetemplates
<template name="magento2:__" value="&lt;?php echo __('$SELECTION$'); ?&gt;" description="Translation" toReformat="false" toShortenFQNames="true">
<context>
<option name="HTML" value="true" />
<option name="PHP" value="true" />
</context>
</template>
<template name="magento2:collection" value="class Collection extends AbstractCollection&#10;{&#10; /**&#10; * Initialize resource model&#10; *&#10; * @return void&#10; */&#10; protected function _construct()&#10; {&#10; $this-&gt;_init($model$::class, $resourceModel$::class);&#10; }&#10;}" toReformat="true" toShortenFQNames="true">
<variable name="model" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="resourceModel" expression="" defaultValue="" alwaysStopAt="true" />
<context>
@6ui11em
6ui11em / ht_redirect.txt
Created May 2, 2012 17:53 — forked from crazy4groovy/ht_redirect.txt
htaccess: Redirection rules
RewriteEngine On
RewriteBase /
### Redirect www to non-www ###
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
### Redirect non-www to www ###
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
@6ui11em
6ui11em / gist:2004290
Created March 9, 2012 00:17
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@6ui11em
6ui11em / php-curl-post.php
Created March 8, 2012 07:55 — forked from davidvanvickle/php-curl-post.php
PHP: Curl post and write to file
$ch = curl_init($post_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('data1'=>'val','data2'=>'val2')));
$data_str = curl_exec($ch);
curl_close($ch);
file_put_contents($path_to_xml_data,$data_str);
@6ui11em
6ui11em / gist:1994233
Created March 7, 2012 16:35 — forked from yvesvanbroekhoven/jquery-extlink.js
JQuery: Open external link in a new window
/*
* Open external link in a new window
*/
$('a:not([href^="'+ window.location.protocol + '//' + window.location.host + '"]):not([href^="#"]):not([href^="/"])')
.attr('target', '_blank');