Skip to content

Instantly share code, notes, and snippets.

// core/server/data/validation/index.js
validator.extend('isSlug', function isSlug(str) {
return validator.matches(str, /^[a-z0-9\-_ㄱ-ㅎㅏ-ㅣ가-힣]+$/);
});
// core/server/lib/security/string.js
// Remove non ascii characters
// string = unidecode(string);
var schema = require('../schema').tables,
_ = require('lodash'),
validator = require('validator'),
moment = require('moment-timezone'),
assert = require('assert'),
Promise = require('bluebird'),
common = require('../../lib/common'),
settingsCache = require('../../services/settings/cache'),
urlService = require('../../services/url'),
@yhbyun
yhbyun / Magento1ValetDriver.php
Last active May 2, 2017 06:11
Magento 1 Driver for Valet. Put this in ~/.valet/Drivers folder.
<?php
class Magento1ValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@yhbyun
yhbyun / 1.markdown
Created April 12, 2016 12:59 — forked from pinedamg/1.markdown
My Magento Snippets

My Magento Snippets

Checkout virtual - downloadable product

<?php

require_once '../app/Mage.php';
 
Varien_Profiler::enable();

Chapter 5. Basic Types and Operations

5.1 Soms basic types

  • integral types : Byte, Short, Int, Long, Char
  • numeric types : integral types + Float, Double
  • String을 제외한 모든 타입은 scala패키지에 있다.
    • Int는 scala.Int
@yhbyun
yhbyun / CategoryTreePathExportMagento.php
Created November 4, 2015 01:57 — forked from tegansnyder/CategoryTreePathExportMagento.php
Export Category Tree and Paths for Magento
<?php
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';
Mage::app();
$category = Mage::getModel ('catalog/category');
$tree = $category->getTreeModel();
$tree->load();
@yhbyun
yhbyun / designer.html
Created July 30, 2014 16:02
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@yhbyun
yhbyun / tmux.zsh
Last active August 29, 2015 13:59
osx iterm2에서 tmux 실행시 세션이름에 따라 탭 색상을 변경하는 zsh 스크립트
# Usage:
# source tmux.zsh
# iTerm2 window/tab color commands
# Requires iTerm2 >= Build 1.0.0.20110804
# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes
# Change the color of the tab when using tmux
# reset the color after the tmux exits
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple text editor with undo/redo features</title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
function Originator() {
this.prop = {};
}
@yhbyun
yhbyun / python_resources.md
Created December 5, 2013 16:23 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides