Skip to content

Instantly share code, notes, and snippets.

@flashbag
flashbag / prestashop-nginx-config
Created November 2, 2019 11:44
PrestaShop Nginx config
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
root /prestashop;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name _;
@flashbag
flashbag / catch-all-document-events.js
Created March 8, 2019 09:53
JS: Catch all document events
/*
function getAllEventTypes(){
if(location.href !='https://developer.mozilla.org/en-US/docs/Web/Events') return;
var types = {};
$('.standard-table:eq(0) tr').find('td:eq(1)').map(function(){
var type = $.trim(this.innerText) || 'OtherEvent';
types[type] = types[type] || [];
@flashbag
flashbag / gist:6cd250cbaf4ee4733131127c98c22ff9
Last active October 11, 2017 09:49
Lyrics of song I ca't find! Maybe you can help.
Found this song here:
https://soundcloud.com/phonique/dark-deep-techhouse-for-bedrooms-dancefloors
Started from 48:00
-----------------------------------------------------------------------------
it doesnt matter what you creates if you have no fun
pretty girl put down your pen, come over here, i'll show you how it's done
{
"158": {
"joindate": "2017-09-01 19:00:20",
"lastonline": "2017-09-27 04:46:02",
"postcount": 100,
"username": "Dido",
"userslug": "dido"
},
"166": {
"joindate": "2017-09-01 07:17:39",
Origin: Node Source
Label: Node Source
Codename: xenial
Date: Tue, 12 Sep 2017 18:17:26 UTC
Architectures: i386 amd64 armhf arm64
Components: main
Description: Apt Repository for the Node.JS 8.x Branch
MD5Sum:
690fa8065d813a7d470766434b160c42 2303 main/binary-i386/Packages
f75e6a64cee8a690b0675e4bcaf8847e 1000 main/binary-i386/Packages.gz
{
"available_for_rent": 1,
"available_periods": [
{
"date_from": "2017-05-12",
"date_to": "2017-05-23"
},
{
"date_from": "2017-07-01",
#!/bin/bash
find /var/lib/jenkins/workspace -type f -name "composer.json" | grep -v '/vendor' | grep -v "Hongi" | while read file;
do echo $file | grep "laravel-push-notification";
done
public function friends()
{
return $this->belongsToMany(self::class, 'friends', 'user_id', 'friend_id')
->withPivot([ 'status_id' ])
->withTimestamps();
}
public function friendOf()
{
return $this->belongsToMany(self::class, 'friends', 'friend_id', 'user_id')
(
SELECT
dev_feed_posts.id,
dev_feed_posts.user_id,
dev_feed_posts.status,
dev_feed_posts.lat,
dev_feed_posts.lng,
dev_feed_posts.created_at,
@flashbag
flashbag / gist:d05edd1de6dc0e28af6633b071987aa2
Last active March 14, 2017 09:56
ST_DISTANCE_SPHERE error
SELECT
*, `derived`.`distance`
FROM
`docks`
INNER JOIN
(SELECT
`id`,
(ST_DISTANCE_SPHERE(POINT(lng, lat), ST_GEOMFROMTEXT('POINT(10.17 45.17)')) / 1000) AS distance
FROM
`docks`) AS derived ON `derived`.`id` = `docks`.`id`