Skip to content

Instantly share code, notes, and snippets.

View refaelgold's full-sized avatar
🎯
Focusing

Nir Goldman refaelgold

🎯
Focusing
View GitHub Profile
@rafaelstz
rafaelstz / Magento2-API-OAuth-based_authentication.php
Last active September 8, 2023 06:15
Sample files to use Magento 2 REST and SOAP API. Using Token-based authentication and OAuth-based authentication method.
<?php
function sign($method, $url, $data, $consumerSecret, $tokenSecret)
{
$url = urlEncodeAsZend($url);
$data = urlEncodeAsZend(http_build_query($data, '', '&'));
$data = implode('&', [$method, $url, $data]);
$secret = implode('&', [$consumerSecret, $tokenSecret]);
@matt-bailey
matt-bailey / customer_account.xml
Last active July 3, 2023 23:10
Disable My Account sidebar links in Magento 2
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!-- Remove unwanted account navigation links -->
@syammohanmp
syammohanmp / Vendor.php
Last active May 12, 2020 14:51
Create Custom Product Attribute with Source Model in Magento 1.9.x
<?php
class Mynamespace_Mymodule_Model_Product_Attribute_Source_Vendor extends Mage_Eav_Model_Entity_Attribute_Source_Abstract {
public function getAllOptions() {
// $options[] = array('value' => 0, 'label' => 'Select Vendor');
@mokanfar
mokanfar / mag-nightly.sh
Last active February 17, 2016 02:29
Magento Magmi Import Cron Bash Script
#!/bin/bash
####################### BEGIN CONFIG #######################
csv_sheet_url='http://dev.com/example.csv'
csv_sheet_path='/home/dev/magmi.csv'
tmp_file_path='/home/dev/tmp_magmi.csv'
magmi_cli_path='/home/dev/magmi/cli/magmi.cli.php'
log_file='/home/dev/log.txt'
profile='Default'
######################## END CONFIG ########################

The Laracasts PHPStorm theme - modified.

This is a slightly modified version of the great Laracasts PHPStorm theme. I've added some styles for Verions Control (add, modified, deleted line...) and fixed some missing things like warnings.

Download

image

Mac: Add to ~/Library/Preferences/WebIde80/colors

@AsafHaas
AsafHaas / gist:9998278
Created April 5, 2014 21:25
חד גדיא
package com.asaf.passover.songs;
public class HadGadia
{
public static void printUnderLine(int dashes)
{
for (int i = 0; i <= dashes; i++)
System.out.print("-");
System.out.println();
}
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@antonmakarenko
antonmakarenko / translation-magento2x.md
Last active March 21, 2021 21:26
Translation Mechanism in Magento 2.x Platform

Translation Mechanism in Magento 2.x Platform

This article discusses the translation mechanism in Magento 2.x, and contrasts it with that of Magento 1.x. The intended audience is Magento developers who would like to better learn the Magento architecture.

The Magento 2.x source code described here has been available since Magento 2.0.0.0-dev46 release and can be viewed on the GitHub at https://github.com/magento/magento2/commit/0849373d7636cfa17b70b8188bfc36d13ae749c1 or later commits.

Implementation Overview in Magento 1.x

Magento 1.x can present the user interface in different languages without modifying the actual application source code—it translates the system messages, error messages, and labels for display in the UI. Some messages may be displayed in logs for a system administrator or a developer—those don't need to be translated. By convention, in the source code, the labels and system messages for UI are expressed in English (en_US).

@andyj
andyj / html_for_international_calling coes.htm
Created October 22, 2013 21:57
HTML <select> international calling codes for each country
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>