Skip to content

Instantly share code, notes, and snippets.

View prestancedesign's full-sized avatar

Michael Salihi prestancedesign

View GitHub Profile
@alexsegura
alexsegura / gist:9650651
Last active July 9, 2022 10:41
Prestashop 1.6 folder permissions
chmod a+w -R config/
chmod a+w -R cache/
chmod a+w -R log/
chmod a+w -R img/
chmod a+w -R mails/
chmod a+w -R modules/
chmod a+w -R themes/default-bootstrap/lang/
chmod a+w -R themes/default-bootstrap/pdf/lang/
chmod a+w -R themes/default-bootstrap/cache/
chmod a+w -R translations/
@hereswhatidid
hereswhatidid / Media.php
Last active December 11, 2019 08:50
PrestaShop Media class override to allow for forcing some inline JavaScripts to remain inline.
<?php
Class Media extends MediaCore
{
public static function deferScript($matches)
{
if (!is_array($matches))
return false;
$inline = '';
if (isset($matches[0]))
@KonradIT
KonradIT / readme.md
Last active September 25, 2023 01:55
GoPro Studio for Linux
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 23, 2024 12:17
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@eldritchideen
eldritchideen / project.clj
Last active April 2, 2024 16:00
Web scraping in Clojure with Jsoup
(ns scraping.core
(:gen-class)
(:import (org.jsoup Jsoup)
(org.jsoup.select Elements)
(org.jsoup.nodes Element)))
(def URL "http://www.smh.com.au/business/markets/52-week-highs?page=-1")
(defn get-page []
(.get (Jsoup/connect URL)))
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@codersofthedark
codersofthedark / clean.sh
Last active April 29, 2021 03:47
MySQL Replication: 'Duplicate entry for PRIMARY key'
while [ 1 ]; do if ['mysql -uroot -ppassword -e"show slave status \G;" | grep "Duplicate entry" | wc -l' -eq 2 ] ; then mysql -uroot -ppassword -e"stop slave; set global sql_slave_skip_counter=1; start slave;"; fi; sleep 1; mysql -uroot -ppassword -e"show slave status\G"; done
@prestarocket
prestarocket / Media.php
Created January 26, 2015 21:08
Override Media.php to keep some files in header
<?php
Class Media extends MediaCore
{
public static function deferScript($matches)
{
if (!is_array($matches))
return false;
$inline = '';