Skip to content

Instantly share code, notes, and snippets.

View WhereJuly's full-sized avatar

WhereJuly WhereJuly

  • Berditshev, Ukraine
View GitHub Profile

Preamble

I have used WebStorm at work for the past three years. But last month I used VSCode exclusively for four weeks, because I wanted to learn it. I noted my observations here.

Eventually, as a deadline approached, I switched back to WebStorm. Why? VSCode is very good, and I was impressed. But I still find WebStorm is slightly better at a few things which I use very frequently. These small improvements really add up when I'm trying to get stuff done.

In keeping with the Pareto principle, small advantages with only a few commonly used features are enough to make one editor stand out for me. Specifically, "Go to Definition/References", "Searching" and "Carrying imports" are so important, that just making these more convenient means that all other concerns are irrelevant.

So, for the reader's convenience, these are the first few features I will address below.

@studiojason
studiojason / excerpt.twig
Created January 25, 2018 20:25
Timber Post Excerpt
<!-- Strip tags from post content and filter through truncate -->
{{ function("strip_tags", post.content)|truncate(50) }}
@JaisonBrooks
JaisonBrooks / remove_input_number_scroll.js
Last active July 11, 2022 15:09
Disable Input[type=number] scroll action
// Disable Mouse scrolling
$('input[type=number]').on('mousewheel',function(e){ $(this).blur(); });
// Disable keyboard scrolling
$('input[type=number]').on('keydown',function(e) {
var key = e.charCode || e.keyCode;
// Disable Up and Down Arrows on Keyboard
if(key == 38 || key == 40 ) {
e.preventDefault();
} else {
return;
@spekkionu
spekkionu / composer.json
Created October 9, 2014 20:07
Standalone validation using laravel validation component
{
"name": "spakkionu/validate",
"description": "Validation Test",
"require": {
"illuminate/validation": "~4.2.9"
},
"license": "MIT",
"authors": [
{
"name": "Jonathan Bernardi",
@Integralist
Integralist / Design Patterns: Adapter vs Facade vs Bridge.md
Last active March 27, 2024 08:22
Design Patterns: Adapter vs Facade vs Bridge

The three design patterns (Adapter, Facade and Bridge) all produce the result of a clean public API. The difference between the patterns are usually due to a subtle context shift (and in some cases, a behavioural requirement).

Adapter

The primary function of an Adapter is to produce a unified interface for a number of underlying and unrelated objects.

You will notice this pattern being utilised in many applications. For example, ActiveRecord (the popular Ruby ORM; object-relational mapping) creates a unified interface as part of its API but the code underneath the interface is able to communicate with many different types of databases. Allowing the consumer of the API to not have to worry about specific database implementation details.

The principle structure of this pattern is:

@alojzije
alojzije / connectHTMLelements_SVG.png
Last active May 13, 2024 08:16
Connect two elements / draw a path between two elements with SVG path (using jQuery)
connectHTMLelements_SVG.png