Skip to content

Instantly share code, notes, and snippets.

😴
Not coding

Jesus Leon JesusLeon

😴
Not coding
Block or report user

Report or block JesusLeon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View php.php
$article_supplier = Shopware()->Db()->fetchAll("SELECT a.id article, s.name supplier FROM s_articles a, s_articles_vote av, s_articles_supplier s WHERE a.id = av.articleID AND s.id = a.supplierID GROUP BY (av.articleID)");
foreach ($article_supplier as $a_s) {
$sql = "UPDATE `s_articles_vote`
SET
`supplierName` = '" . $a_s['supplier'] . "'
WHERE
`voteID` = '" . $a_s['article'] . "'
";
@JesusLeon
JesusLeon / prepare-commit-msg.sh
Last active Jul 23, 2018 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
View prepare-commit-msg.sh
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
# BRANCH_NAME="${BRANCH_NAME##*/}"
View redmine_better_comments.js
// ==UserScript==
// @name Redmine better comments
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://somedomain.com/**
// @grant none
// ==/UserScript==
@JesusLeon
JesusLeon / OrderMod_Bootstrap.php
Created Jan 13, 2017 — forked from sthamann/OrderMod_Bootstrap.php
Advanced Example how to create 2 custom fields, fill them in order process, display them in backend order list as new columns and make them editable in order detail view
View OrderMod_Bootstrap.php
<?php
class Shopware_Plugins_Frontend_OrderMod_Bootstrap extends Shopware_Components_Plugin_Bootstrap
{
/**
* (non-PHPdoc)
* @see Shopware_Components_Plugin_Bootstrap::install()
*/
public function install()
{
View git fire
git config --global alias.fire '!git checkout -b fire && git add -A && git commit -m "fire!" && git push origin fire'
# or friday or 6 o'clock :)
git config --global alias.friday '!git checkout -b friday && git add -A && git commit -m "friday!" && git push origin friday'
git config --global alias.6oclock '!git checkout -b 6oclock && git add -A && git commit -m "6oclock!" && git push origin 6oclock'
@JesusLeon
JesusLeon / .DevNotes.md
Last active Oct 8, 2015
Development Notes
View .DevNotes.md

NOTE: I'm now writing my dev-notes on my Log at http://log.iamjessu.com

Development Notes

A collection of development related notes and ideas. Spontaneously thought along the daily work. Seemed rational when they were conceived.

Warning: Some ambiguity may occur. And excecution details may be needed :)

@JesusLeon
JesusLeon / pubsub.js
Last active Aug 29, 2015 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
View pubsub.js
// Event - a super-basic Javascript (publish subscribe) pattern
var Event = {
event: {},
listen: function (eventName, fn) {
this.event[eventName] = this.event[eventName] || [];
this.event[eventName].push(fn);
},
@JesusLeon
JesusLeon / CS_fixer.sh
Created Jul 30, 2015
Php Code Style Fixers
View CS_fixer.sh
php-cs-fixer fix --fixers=multiline_array_trailing_comma,operators_spaces,return,unused_use,concat_with_spaces,short_array_syntax,whitespacy_lines .
@JesusLeon
JesusLeon / JS_Parser.js
Last active Aug 29, 2015
A small JS {string} parser
View JS_Parser.js
function parse(template, data) {
var replacer = function (context) {
return function (placeholder, name) {
return context[name];
};
};
return template.replace(/\{(\w+)\}/g, replacer(data));
}
@JesusLeon
JesusLeon / list_open_apps.applescript
Created Jul 27, 2015
List open apps applescript
View list_open_apps.applescript
tell application "System Events"
-- get properties of every process where background only is false
set listOfProcesses to (title of every process where background only is false)
tell me to set selectedProcesses to choose from list listOfProcesses with multiple selections allowed
end tell
You can’t perform that action at this time.