Skip to content

Instantly share code, notes, and snippets.

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

Paul Nike m4tlch

🏠
Working from home
  • Ukraine
View GitHub Profile
099 270 30 40 позвони и тебе все объясняет, автошкола в центре
You can call 0 800 308 80 01 / +380 44 230 5101 44 230 5101 You can visit our support page at https://support.microsoft.com/en-us/contactus and choose services and apps
Опыт работы от 50 лет.
Вы должны победить дракона.
Ненормированный рабочий день.
Наличие прав на управление вертолетом.
Умение программировать на всех возможных языках.
Знание языка суахили не ниже уровня upper intermediate.
Расширение клиентской базы на 100500 человек в день.
Знание основ термоядерного синтеза.
Опыт в организации концертов Бориса Моисеева в Дагестане.
Ублюдок, мать твою, а ну иди сюда, говно собачье, а ну решил ко мне лезть, ты... засранец вонючий, мать твою. А?! ну иди сюда, попробуй меня трахнуть, я тебя сам трахну ублюдок, анонист чертов, будь ты проклят, иди идиот, трахать тебя за свою семью, говно собачье, жлоб вонючий, дерьмо, сука, падла, иди сюда мерзавец, негодяй, гад, иди сюда ты говно, жопа!
Deleted Field Tables keep multiplying
When you delete a field, if there is data in it, Drupal does a bit of a two-step shuffle to avoid locking the tables while it gets rid of them, so it moves them to other tables so it can go through them one at a time when cron runs.
Sometimes this process does not clean itself up. You will notice It by seeing the number of tables in your DB grow and the DB will contain lots of
tables like this
field_deleted_data_103
field_deleted_data_105
field_deleted_data_109
@m4tlch
m4tlch / gist:ecc24408f50b8fa1b9ea
Created May 1, 2015 08:13
That deleted all locale strings without translation. The ones that really exist will be rebuilt on the next page access. All others are gone.
DELETE locales_source FROM locales_source left join locales_target lt using (lid) where lt.lid is null;
@m4tlch
m4tlch / .htaccess
Last active August 29, 2015 14:19 — forked from steffenr/.htaccess
# KILL THEM ETAGS
# http://www.askapache.com/htaccess/apache-speed-etags.html
FileETag none
# set expires header
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf|woff|eot|svg|ttf)$">
Header set Expires "Tue, 16 Jun 2020 20:00:00 GMT"
</FilesMatch>
# turn on gzip compression
# Redirect to HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
<?php
function my_module_product_add($pid,$quantity=1){
if ($product = commerce_product_load($pid) ) {
global $user;
//uid of the logged in user
$uid = $user->uid;
$line_item = commerce_product_line_item_new($product, $quantity);
$line_item->field_ticket_type['und'][]['value'] = 0;