Skip to content

Instantly share code, notes, and snippets.

View anunay's full-sized avatar
🏠
Working from home

Anunay Dahal anunay

🏠
Working from home
View GitHub Profile
@anunay
anunay / magento-newsletter-subscriber-import.php
Created December 3, 2013 05:19
Magento: Newsletter subscriber import script
<?php
require_once("./app/Mage.php");
Mage::app();
$subscribers = array('[email protected]', '[email protected]');
foreach ($subscribers as $email) {
# create new subscriber without send an confirmation email
Mage::getModel('newsletter/subscriber')->setImportMode(true)->subscribe($email);
@anunay
anunay / magento-subscriber-listing.php
Created December 3, 2013 05:21
Magento: Subscriber List
<?php
require_once("./app/Mage.php");
Mage::app();
$collection = Mage::getResourceModel('newsletter/subscriber_collection')->load();
foreach($collection->getItems() as $subscriber) {
echo $subscriber->getSubscriberEmail();
}
?>
@anunay
anunay / magento-delete-all-data.php
Last active December 30, 2015 02:39
Magento: Delete All Products & Categories
Magento Delete All Products & Categories from database
@anunay
anunay / magento-customer-subscripiton.php
Created December 3, 2013 05:52
Magento: Create Customer & Subscription Programtically
<?php
error_reporting(E_ALL | E_STRICT);
$mageFilename = 'app/Mage.php';
if (!file_exists($mageFilename)) {
if (is_dir('downloader')) {
header("Location: downloader");
} else {
echo $mageFilename." was not found";
}
@anunay
anunay / gist:7765442
Created December 3, 2013 07:41
Magento: Get Observers To Work In An External Script?
Magento: Get Observers To Work In An External Script?
@anunay
anunay / javascript-csv-generate.js
Created December 3, 2013 08:02
JavaScript : Create CSV File
var fullList = [];
$(".list-wrapper").each(function() {
var tempStr = "";
tempStr = '"' + $(this).find(".company-list-name a").text() + '"';
tempStr += ',"' + $(this).find(".profile-update").text() + '"';
tempStr += ',"' + $(this).find(".company-focus").text() + '"';
fullList.push(tempStr);
});
var output = fullList.join('\n');
var uri = 'data:application/csv;charset=UTF-8,' + encodeURIComponent(output);
@anunay
anunay / webserver.sh
Created December 3, 2013 09:45
Python: Start Simple Python Webserver
python -m SimpleHTTPServer 8000
@anunay
anunay / anunay-sublime-config.json
Created December 5, 2013 20:41
My Sublime Config
{
"bold_folder_labels": false,
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
@anunay
anunay / jquery-smooth-scroll.js
Last active December 31, 2015 04:39
JQuery Smooth Scroll
//###########################
//jquery fn scroll:
jQuery.fn.skroll = function() {$('body').animate({'scrollTop': this.offset().top}, 'slow', 'swing');};
//# USE: $('.class').skroll();
//###########################
@anunay
anunay / bootstrap-grid-config.txt
Created December 12, 2013 21:13
bootstrap 16 and 24 grid config values for configurator
This method for last version of Bootstrap - Version 2.3.1
Click this link to customize bootstrap: http://twitter.github.com/bootstrap/customize.html
You will find such as this list and change the number as you like.
16 Grid system with Gutter
@gridColumns: 16
@gridColumnWidth: 45px
@gridGutterWidth: 15px