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 / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-ajax/core-ajax.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
@alihalabyah
alihalabyah / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-pages/core-pages.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
# Add new user group
groupadd sftpusers
# Add new user set the directory, the main role and the user name
useradd -g sftpusers -d /dir -s /sbin/nologin username
# Make sure the user can perform SSH login
usermod username -s /sbin/nologin
# Make sure the user has been added
@alihalabyah
alihalabyah / gist:d831d1fbb89e2cf87fef
Created April 8, 2015 10:19
Github mirror Bitbucket or vice versa
git remote add bitbucket /url/to/am/empty/bitbucket/repo
git push --mirror bitbucket
@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:8a7ac8054ad706094cd7d0e0bed25c18
Created February 19, 2017 13:33
Magento2 Get Product Image URL
$store = $objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore();
$imageUrl = $store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();