Skip to content

Instantly share code, notes, and snippets.

View alihalabyah's full-sized avatar
🎯
Focusing

Ali Halabyah alihalabyah

🎯
Focusing
View GitHub Profile
@alihalabyah
alihalabyah / gist:b981ae29b0c948ff26d1
Created April 8, 2015 12:07
How to reset git remote changes
git checkout master
git reset --hard e3f1e37
git push --force origin master
# Then to prove it (it won't print any diff)
git diff master..origin/master
LOAD DATA INFILE 'file.csv' INTO TABLE table_name
FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(col_name);
@alihalabyah
alihalabyah / gist:51d4a9372dcaf31ae474
Created July 10, 2015 11:17
Git remove .DS_Store files
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
## add .DS_Store to .gitignore
git add .gitignore
git commit -m '.DS_Store banished!'
@alihalabyah
alihalabyah / gist:284c7be1419568b350e2
Created November 6, 2015 11:28
Read & Write Access to Group
# First of all make sure that the user is added to the group (the group name here is www-data)
sudo usermod -a -G www-data <some_user>
# Then change the group of the directory
sudo chgrp -R www-data /var/www
# Finally, give group write permissions
sudo chmod -R g+w /var/www
@alihalabyah
alihalabyah / gist:8285055
Created January 6, 2014 16:09
Get country name by country code - Magento
<?php
$country_name=Mage::app()->getLocale()->getCountryTranslation($country_code);
?>
@alihalabyah
alihalabyah / gist:fba4660d0d3f4c3c85a3
Last active May 9, 2017 13:10
Magento postal code javascript error: error: error in [unknown object].fireEvent(): event name: address_country_changed error message: zipElement.up(1).down("label > span.required") is undefined Fix! ___ Update file: app\design\adminhtml\default\default\template\directory\js\optional_zip_countries.phtml
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@alihalabyah
alihalabyah / gist:8423759
Created January 14, 2014 19:00
jQuery countTo plugin
<script type="text/javascript">
(function($) {
$.fn.countTo = function(options) {
// merge the default plugin settings with the custom options
options = $.extend({}, $.fn.countTo.defaults, options || {});
// how many times to update the value, and how much to increment the value on each update
var loops = Math.ceil(options.speed / options.refreshInterval),
increment = (options.to - options.from) / loops;
nc -u -w 2 -v 159.89.213.212 13543
sudo ufw status
sudo ufw disable
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo iptables -L -n -v
sudo netstat -plutn