Skip to content

Instantly share code, notes, and snippets.

@JesusLeon
JesusLeon / menu_click.scpt
Created May 3, 2020 11:21
A better way to activate menu items from AppleScript
-- `menu_click`, by Jacob Rus, September 2006
--
-- Accepts a list of form: `{"Finder", "View", "Arrange By", "Date"}`
-- Execute the specified menu item. In this case, assuming the Finder
-- is the active application, arranging the frontmost folder by date.
on menu_click(mList)
local appName, topMenu, r
-- Validate our input
@JesusLeon
JesusLeon / JS+CSS Dark Mode.js
Created May 2, 2020 14:59
Invert sites to a darker gamma correction (pseudo dark mode)
// ==UserScript==
// @name Dark mode
// @namespace https://mmis1000.me/
// @version 0.4
// @description Invert the whold website
// @author MMis1000
// @include http://*
// @include https://*
// @grant none
// ==/UserScript==
$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 July 23, 2018 08:52 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/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##*/}"
@JesusLeon
JesusLeon / redmine_better_comments.js
Last active February 2, 2017 12:47
UserScripts for Redmine
// ==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 January 13, 2017 09:02 — 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
<?php
class Shopware_Plugins_Frontend_OrderMod_Bootstrap extends Shopware_Components_Plugin_Bootstrap
{
/**
* (non-PHPdoc)
* @see Shopware_Components_Plugin_Bootstrap::install()
*/
public function install()
{
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 October 8, 2015 19:03
Development Notes

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 August 29, 2015 14:27 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
// 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 July 30, 2015 11:50
Php Code Style Fixers
php-cs-fixer fix --fixers=multiline_array_trailing_comma,operators_spaces,return,unused_use,concat_with_spaces,short_array_syntax,whitespacy_lines .