Skip to content

Instantly share code, notes, and snippets.

View imadphp's full-sized avatar

Imad imadphp

  • Netherlands
View GitHub Profile
@imadphp
imadphp / supervisor.conf
Created September 19, 2019 20:06 — forked from hezhao/myapp.conf
Example supervisor config file /etc/supervisor/conf.d/myapp.conf
[program:myapp]
autostart = true
autorestart = true
command = python /home/pi/myapp.py
environment=SECRET_ID="secret_id",SECRET_KEY="secret_key_avoiding_%_chars"
stdout_logfile = /home/pi/stdout.log
stderr_logfile = /home/pi/stderr.log
startretries = 3
user = pi
@imadphp
imadphp / words.md
Created September 18, 2019 18:28 — forked from fogleman/words.md
Mnemonic Encoding Word List

Mnemonic Encoding Word List

http://web.archive.org/web/20090918202746/http://tothink.com/mnemonic/wordlist.html

  • The wordlist contains 1626 words.
  • All words are between 4 and 7 letters long.
  • No word in the list is a prefix of another word (e.g. visit, visitor).
  • Five letter prefixes of words are sufficient to be unique.
  • The words should be usable by people all over the world. The list is far from perfect in that respect. It is heavily biased towards western culture and English in particular. The international vocabulary is simply not big enough. One can argue that even words like "hotel" or "radio" are not truly international. You will find many English words in the list but I have tried to limit them to words that are part of a beginner's vocabulary or words that have close relatives in other european languages. In some cases a word has a different meaning in another language or is pronounced very differently but for the purpose of the encoding it is still ok - I assume that when the encoding is
@imadphp
imadphp / MAGESTORE_STORE_LOCATOR_SQLI.patch
Created March 11, 2019 13:36
A patch to fix SQLi vulnerability in Magestore Store Locator module and Magento addExpressionFieldToSelect() method
diff --git a/vendor/magestore/storepickup/app/code/Magestore/Storepickup/Model/ResourceModel/Store/Collection.php b/vendor/magestore/storepickup/app/code/Magestore/Storepickup/Model/ResourceModel/Store/Collection.php
index 5a48b364a..87a855904 100644
--- a/vendor/magestore/storepickup/app/code/Magestore/Storepickup/Model/ResourceModel/Store/Collection.php
+++ b/vendor/magestore/storepickup/app/code/Magestore/Storepickup/Model/ResourceModel/Store/Collection.php
@@ -106,8 +106,8 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\Ab
*/
public function addLatLngToFilterDistance($lat, $lng, $distance = null)
{
- $expression = "(1609.34*((acos(sin(({{lat}}*pi()/180)) * sin((`{{latitude}}`*pi()/180))+cos(($lat *pi()/180)) * cos((`{{latitude}}`*pi()/180)) * cos((({{lng}} - `{{longitude}}`)*pi()/180))))*180/pi())*60*1.1515)";
- $this->addExpressionFieldToSelect('distance', $expression, ['latitude' => 'latitude', 'longitude' => 'longitude', 'lat' => $lat, 'lng
@imadphp
imadphp / PasswordField.vue
Last active January 31, 2024 17:51
Show/Hide password in VueJS (Bootstrap, FontAwesome)
<template>
<div class="form-inline">
<div v-if="!passwordHidden">
<label>
<span class="strong-label">{{ fieldLabel }}</span>
<input type="text" class="password-field form-control d-inline" v-model="passwordText" />
<span class="display-eye fa fa-eye-slash" @click="hidePassword"></span>
</label>
</div>
<div v-if="passwordHidden">