Giter VIP home page Giter VIP logo

all-in-one-snippets-visual-studio-code's Introduction

russia invaded Ukraine
support Ukraine

All IN ONE SNIPPETS (PHP, SQL, HTML, CSS, SCSS, SASS, JS, jQuery) README

All IN ONE SNIPPETS (PHP, SQL, HTML, CSS, SCSS, SASS, JS, jQuery).
This extension will help you faster to make common using snippets.

All in one snippets to help you be more productive when developing in PHP

Support tab to previous/next slug.

Snippets jQuery

jQuery Code Snippets for JavaScript code.

Just type the letters 'jq' to get a list of all available jQuery Code Snippets.

Image of Snippets

Trigger Description
func An anonymous function.
jqAfter Insert content, specified by the parameter, after each element in the set of matched elements.
jqAjax Perform an asynchronous HTTP (Ajax) request.
jqAjaxAspNetWebService Perform an asynchronous HTTP (Ajax) request to a ASP.NET web service.
jqAppend Insert content, specified by the parameter, to the end of each element in the set of matched elements.
jqAppendTo Insert every element in the set of matched elements to the end of the target.
jqAttrGet Get the value of an attribute for the first element in the set of matched elements.
jqAttrRemove Remove an attribute from each element in the set of matched elements.
jqAttrSet Set one or more attributes for the set of matched elements.
jqAttrSetFn Set one or more attributes for the set of matched elements.
jqAttrSetObj Set one or more attributes for the set of matched elements.
jqBefore Insert content, specified by the parameter, before each element in the set of matched elements.
jqBind Attach a handler to an event for the elements.
jqBindWithData Attach a handler to an event for the elements.
jqBlur Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
jqChange Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
jqClassAdd Adds the specified class(es) to each of the set of matched elements.
jqClassRemove Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
jqClassToggle Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence.
jqClassToggleSwitch Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
jqClick Bind an event handler to the "click" JavaScript event, or trigger that event on an element.
jqClone Create a deep copy of the set of matched elements.
jqCloneWithEvents Create a deep copy of the set of matched elements.
jqCssGet Get the computed style properties for the first element in the set of matched elements.
jqCssSet Set one or more CSS properties for the set of matched elements.
jqCssSetObj Set one or more CSS properties for the set of matched elements.
jqDataGet Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
jqDataRemove Remove a previously-stored piece of data.
jqDataSet Store arbitrary data associated with the matched elements.
jqDataSetObj Store arbitrary data associated with the matched elements.
jqDie Remove event handlers previously attached using .live() from the elements.
jqDieAll Remove event handlers previously attached using .live() from the elements.
jqDieFn Remove event handlers previously attached using .live() from the elements.
jqDocReady Function to execute when the DOM is fully loaded.
jqDocReadyShort Function to execute when the DOM is fully loaded.
jqEach A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
jqEachElement Iterate over a jQuery object, executing a function for each matched element.
jqEmpty Remove all child nodes of the set of matched elements from the DOM.
jqFadeIn Display the matched elements by fading them to opaque.
jqFadeInFull Display the matched elements by fading them to opaque.
jqFadeOut Hide the matched elements by fading them to transparent.
jqFadeOutFull Hide the matched elements by fading them to transparent.
jqFadeTo Adjust the opacity of the matched elements.
jqFadeToFull Adjust the opacity of the matched elements.
jqFind Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
jqFocus Bind an event handler to the "focus" JavaScript event, or trigger that event on an element.
jqGet Load data from the server using a HTTP GET request.
jqGetJson Load JSON-encoded data from the server using a GET HTTP request.
jqGetScript Load a JavaScript file from the server using a GET HTTP request, then execute it.
jqHasClass Determine whether any of the matched elements are assigned the given class.
jqHeightGet Get the current computed height for the first element in the set of matched elements.
jqHeightSet Set the CSS height of every matched element.
jqHide Hide the matched elements.
jqHideFull Hide the matched elements.
jqHover Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
jqHtmlGet Get the HTML contents of the first element in the set of matched elements.
jqHtmlSet Set the HTML contents of each element in the set of matched elements.
jqInnerHeight Get the current computed height for the first element in the set of matched elements, including padding but not border.
jqInnerWidth Get the current computed inner width for the first element in the set of matched elements, including padding but not border.
jqInsertAfter Insert every element in the set of matched elements after the target.
jqInsertBefore Insert every element in the set of matched elements before the target.
jqKeyDown Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element.
jqKeyPress Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element.
jqKeyUp Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element.
jqLoadGet Load data from the server and place the returned HTML into the matched element.
jqLoadPost Load data from the server and place the returned HTML into the matched element.
jqMap Translate all items in an array or object to new array of items.
jqMouseDown Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element.
jqMouseEnter Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.
jqMouseLeave Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.
jqMouseMove Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element.
jqMouseOut Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element.
jqMouseOver Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element.
jqMouseUp Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element.
jqNamespace A namespace template. ref: http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/
jqOffsetGet Get the current coordinates of the first element, or set the coordinates of every element, in the set of matched elements, relative to the document.
jqOffsetParent Get the closest ancestor element that is positioned.
jqOn Attach an event handler function for one or more events to the selected elements.
jqOne Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
jqOneWithData Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
jqOuterHeight Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns a number (without "px") representation of the value or null if called on an empty set of elements.
jqOuterWidth Get the current computed width for the first element in the set of matched elements, including padding and border.
jqPlugin Plugin template.
jqPosition Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
jqPost Load data from the server using a HTTP POST request.
jqPrepend Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
jqPrependTo Insert every element in the set of matched elements to the beginning of the target.
jqRemove Remove the set of matched elements from the DOM.
jqRemoveExp Remove the set of matched elements from the DOM.
jqReplaceAll Replace each target element with the set of matched elements.
jqReplaceWith Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
jqResize Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.
jqScroll Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element.
jqScrollLeftGet Get the current horizontal position of the scroll bar for the first element in the set of matched elements.
jqScrollLeftSet Set the current horizontal position of the scroll bar for each of the set of matched elements.
jqScrollTopGet Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.
jqScrollTopSet Set the current vertical position of the scroll bar for each of the set of matched elements.
jqSelect Bind an event handler to the "select" JavaScript event, or trigger that event on an element.
jqSelectTrigger Bind an event handler to the "select" JavaScript event, or trigger that event on an element.
jqShow Display the matched elements.
jqShowFull Display the matched elements.
jqSlideDown Display the matched elements with a sliding motion.
jqSlideDownFull Display the matched elements with a sliding motion.
jqSlideToggle Display or hide the matched elements with a sliding motion.
jqSlideToggleFull Display or hide the matched elements with a sliding motion.
jqSlideUp Display the matched elements with a sliding motion.
jqSlideUpFull Display the matched elements with a sliding motion.
jqSubmit Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.
jqSubmitTrigger Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.
jqTextGet Get the combined text contents of each element in the set of matched elements, including their descendants.
jqTextSet Set the content of each element in the set of matched elements to the specified text.
jqToggle Display or hide the matched elements.
jqToggleFull Display or hide the matched elements.
jqToggleSwitch Display or hide the matched elements.
jqTrigger Execute all handlers and behaviors attached to the matched elements for the given event type.
jqTriggerHandler Execute all handlers attached to an element for an event.
jqTriggerHandlerWithData Execute all handlers attached to an element for an event.
jqTriggerWithData Execute all handlers and behaviors attached to the matched elements for the given event type.
jqUnbind Remove a previously-attached event handler from the elements.
jqUnbindAll Remove a previously-attached event handler from the elements.
jqUnload Bind an event handler to the "unload" JavaScript event.
jqValGet Get the current value of the first element in the set of matched elements.
jqValSet Set the value of each element in the set of matched elements.
jqWidthGet Get the current computed width for the first element in the set of matched elements.
jqWidthSet Set the CSS width of each element in the set of matched elements.
jqWrap Wrap an HTML structure around each element in the set of matched elements.
jqWrapAll Wrap an HTML structure around all elements in the set of matched elements.
jqWrapInner Wrap an HTML structure around the content of each element in the set of matched elements.
Snippets SQL

sample

What's included - contents

Database

Snippet Code Description
s-db create a new database
s-db-drop delete the database

Table

Snippet Code Description
s-table create simple table with INT primary key
s--table create simple table with INT primary key, but first remove the old table
s-table-tmp create simple temporary table with engine=memory
s--table-tmp the same, but first remove the old table

s-many-many - Very powerful snippet! Make table for relation many-to-many, make two foreign key constrain, and two indexes in it and make two indexes in corresponding tables

Create Table components

Snippet Code Description
s-fk make foreign key constrain for table creation
s--fk make foreign key constrain for table creation with corresponding indexes
s-idx make default index for table creation
s-idx-txt make FULLTEXT index for table creation
s-pk make primary key
s-uk make unique key

Insert

Snippet Code Description
s-i insert multirow
s-ione insert one row
s-ifrom isert data from a sample(other table or database)

Select

Snippet Code Description
s-s default select for extending with help query-options
s-sone select one row by where condition
s-sinline inline select for simple a sample
s-smin inline select for search min value
s-smax inline select for search max value
s-scount inline select for count rows in the table
s-ss select a value SELECT '...';
s-sv select a variable SELECT ...;

Query options

Expressions

Snippet Code Description
s- the entity. Like `table`.`column`
s-- the entity with a comma. Like , `table`.`column`
s-alias the entity with alias. Like `table`.`column` AS `my_col`
s--alias the same with comma. Like , `table`.`column` AS `my_col`
s-and a part of conditions AND ( ... )
s-or a part of conditions OR ( ... )
s--and a part of conditions with expression AND ( `col` = `col2` )
s--or a part of conditions with expression OR ( `col` = `col2` )
s-e an expression ( `col` = `col2` )

Statements

Snippet Code Description
s-f from statement like FROM `table` AS `alias`
s-j inner join statement
s-jleft left join statement
s-jright right join statement
s-w where statement
s-o order by statement
s-l limi statement
s-g group by statement
s-h having statement
s-u union statement

Update

Snippet Code Description
s-u default update snippet with where condition

Delete

Snippet Code Description
s-d default delete snippet with where condition

Alter - modify structure

All alter snippets begining from s-alter-* prefix, like s-alter-add.

Columns

Snippet Code Description
add add a column to table at the last column
add-first add a column to table at the first column
add-after add a column to table after someone column
auto-increment change auto_increment counter value
change change the column(rename or change type)
modify modify the column(change type and column order)
drop drop the column from the table

Other

Snippet Code Description
idx add an index to the table
idx-drop drop the index from the table
order sort the table by column(yes it indeed possible!)
table-rename rename the table
table-charset change table charset and collate
db-charset change database charset and collate
fk add foreign key to the table
-fk add foreign key to the table with index
fk-drop drop the foreign key from the table
uk add unique key to exists table

Trigger

Snippet Code Description
s-trig create new trigger
s--trig replace trigger(drop and create new)
s-trig-list list triggers for table
s--trig-list list triggers for table(also specify DB)
s-trig-drop drop the trigger

Procedure

Snippet Code Description
s-proc create new storage procedure
s--proc replace procedure(drop and create new)
s-proc-drop drop the storage procedure
s-proc-list show stored procedures list(only current database)

Function

Snippet Code Description
s-func create new function
s--func replace function(drop and create new)
s-func-drop drop the function
s-func-list show list of user-defined functions(only current database)

Show

Snippet Code Description
s-hcols details of the table (SHOW FULL COLUMNS FROM ...)
s-hcreate show command for creating the table
s-hidx show indexes for the table
s-hrel show relations of a table (using information_schema)

Constructions

Declare

Snippet Code Description
s-dec declare a variable
s--dec declare a variable with default value
s-dec-s declare a string(VARCHAR) variable
s--dec-s declare a string(VARCHAR) variable with default value
s-dec-h declare a CONTINUE HANDLER FOR SQLSTATE
s-dec-cur declare a cursor

Condition

Snippet Code Description
s-if create if statement
s--if create if else statement

Case

Snippet Code Description
s-case CASE var_name WHEN 'value' THEN ... END CASE - value based
s-case-w WHEN 'value' THEN ... ; - value based
s-case-wb WHEN 'value' THEN BEGIN ... END; - value based
s--case CASE WHEN var_name = 'value' THEN ... END CASE - condition based
s--case-w WHEN var_name = 'value' THEN ... ; - condition based
s--case-wb WHEN var_name = 'value' THEN BEGIN ... END; - condition based

Loops

Snippet Code Description
s-loop LOOP ... END LOOP - Complex snippet. With additional logic!
s-repeat REPEAT ... UNTIL ... END REPEAT construct
s--repeat REPEAT BEGIN ... END; UNTIL ... END REPEAT construct

Other

Snippet Code Description
s-cur powerful complex snippet! Makes ready to use cursor

User

Snippet Code Description
s-user-list list all users
s-user-add create a new user
s--user-add create a new user with a password (short access s--u)
s-user-add-hash create new user with a password by hash
s-user-drop remove user
s-user-pwd change user password

Privileges

Snippet Code Description
s-priv-refresh command flush priveleges
s-priv-add add some privileges to user
s-priv-add-all add all privileges to user
s-priv-drop remove some privileges from user
s-priv-drop-all remove all privileges from user
s-priv-list show list of user privileges

Other

Snippet Code Description
s-delim make delimiter $$ statement and at the end delimiter ;
s-utc select current timestamp

Extension Dependencies

All IN ONE SNIPPETS (PHP, SQL, HTML, CSS, SCSS, SASS, JS, jQuery)

Author : Roman Matviy
Site : https://matviy.pp.ua

Source

GitHub

License

MIT

Donate

Buy me a coffee :)

QR Code

donation resass media queries

Or PayPall

Donate

Thank You!


For more information

Our partners

Note

If you have a snippet that you use a lot submit a pull-request!

An issue would also be an easy way to suggest a snippet to be added.

Just add the code that you'd want to be turned in to a snippet and I'll see if I can't get it added.

Known issues

I've not found a way to start a snippet with the leading less than symbol (<...). VS Code also seems to use the opening PHP tag to define it's context insead of the selector in the bottom right of the window (or the extension). So far I've not been able to add a snippet that would twig out an entire script yet.

Enjoy!

all-in-one-snippets-visual-studio-code's People

Contributors

matviyroman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.