Paris Museums Put 60,000+ Historic Photos Online, Copyright-Free

Paris Museums Put 60,000+ Historic Photos Online, Copyright-Free

https://ift.tt/2OaE4SF

Long-time reader schwit1 shares a report: Paris Musees, a group of 14 public museums in Paris, has made a splash by releasing high-res digital images for over 100,000 artworks through a new online portal. All the works were released to the public domain (CC0, or "No Rights Reserved"), and they include 62,599 historic photos by some of the most famous French photographers such as Eugene Atget. The new website, called the Collections portal, was launched on January 8th and offers powerful search and filtering options for finding specific artworks.



Share on Google+

Read more of this story at Slashdot.

geeky

via Slashdot https://slashdot.org/

January 29, 2020 at 03:22PM

Scholars Now Believe Jesus Spent Time With Prostitutes, Tax Collectors Just To Avoid Hanging Out With Loathsome Journalists

Scholars Now Believe Jesus Spent Time With Prostitutes, Tax Collectors Just To Avoid Hanging Out With Loathsome Journalists

https://ift.tt/36DdE2c

Scholars Now Believe Jesus Spent Time With Prostitutes, Tax Collectors Just To Avoid Hanging Out With Loathsome Journalists

ISRAEL—Scholars studying ancient texts from the first century now believe Jesus actually spent time with prostitutes and tax collectors just to avoid hanging out with despicable journalists.

Up until now, Christians have always thought that Jesus hung out with everyone, even those on the dredges of society. But even the loving, compassionate Savior had standards and would not spend any time with news writers.

“Ugh, the journalists are over there — don’t let ’em see me,” He reportedly told tax collector Zaccheus after calling him down from the sycamore tree. “Hide me in your house, quick, so we can get away from those lowlifes.”

“Yeah, you tax collectors are scummy, but at least you’re not a reporter,” he said as they dined and did not try to destroy each other’s lives as journalists would be doing. “You won’t dox people, capitalize on a celebrity’s death for clicks, or try to search through my old tweets.”

Seeing that Jesus was indeed wise, Zaccheus then repented and agreed to pay everyone back and then some for what he had stolen.

“Once I saw that He hated journalists too, I realized He was alright.”

Breaking: Paypal Now Available

Many of you told us you wouldn’t subscribe until we offered Paypal as a payment option. You apparently weren’t bluffing, so we finally caved and added Paypal. Now — like the unbeliever faced with God’s invisible qualities displayed in nature — you are without excuse.

fun

via The Babylon Bee https://babylonbee.com

January 29, 2020 at 03:26PM

Create iCal calendars

Create iCal calendars

https://ift.tt/2PdG8wj

Generate calendars in the iCalendar format

Latest Version on Packagist Build Status Style Quality Score Total Downloads

Using this package, you can generate calendars for applications like Apple’s Calendar and Google Calendar. Calendars will be generated in the iCalendar format (RFC 5545), which is a textual format that can be loaded by different applications. This package tries to implement a minimal version of RFC 5545 with some extensions from RFC 7986. It’s not our intention to implement these RFC’s entirely but to provide a straightforward API that’s easy to use.

Here’s an example of how to use it:

use Spatie\IcalendarGenerator\Components\Calendar; use Spatie\IcalendarGenerator\Components\Event;  Calendar::create('Laracon online')  ->event(Event::create('Creating calender feeds')  ->startsAt(new DateTime('6 March 2019 15:00'))  ->endsAt(new DateTime('6 March 2019 16:00'))  )  ->get();

The above code will generate this string:

BEGIN:VCALENDAR VERSION:2.0 PRODID:spatie/icalendar-generator NAME:Laracon online X-WR-CALNAME:Laracon online BEGIN:VEVENT UID:5cb9d22a00ba6 SUMMARY:Creating calender feeds DTSTART:20190306T150000 DTEND:20190306T160000 DTSTAMP:20190419T135034 END:VEVENT END:VCALENDAR 

Installation

You can install the package via composer:

composer require spatie/icalendar-generator

Usage

Here’s how you can create a calendar:

$calendar = Calendar::create();

You can give a name to a calendar:

$calendar = Calendar::create('Laracon Online');

A description can be added to an calendar:

$calendar = Calendar::create()  ->name('Laracon Online')  ->description('Experience Laracon all around the world');

In the end, you want to convert your calendar to text so it can be streamed or downloaded to the user. Here’s how you do that:

Calendar::create('Laracon Online')->get(); // BEGIN:VCALENDAR ...

When streaming a calendar to an application, it is possible to set the refresh interval for the calendar by duration in minutes. When setting this, the calendar application will check your server every time after the specified duration for changes to the calendar:

Calendar::create('Laracon Online')  ->refreshInterval(5)  ...

Event

An event can be created as follows. A name is not required, but a start date should always be given:

Event::create('Laracon Online')  ->startsAt(new DateTime('6 march 2019'));

You can set the following properties on an event:

Event::create()  ->name('Laracon Online')  ->description('Experience Laracon all around the world')  ->uniqueIdentifier('A unique identifier can be set here')  ->createdAt(new DateTime('6 march 2019'))  ->startsAt(new DateTime('6 march 2019 15:00'))  ->endsAt(new DateTime('6 march 2019 16:00'));

Want to create an event quickly with start and end date?

Event::create('Laracon Online')  ->period(new DateTime('6 march 2019'), new DateTime('7 march 2019'));

You can add a location to an event a such:

Event::create()  ->address('Samberstraat 69D, 2060 Antwerp, Belgium')  ->addressName('Spatie HQ')  ->coordinates(51.2343, 4.4287)  ...

You can set the organizer of an event, the email address is required but the name can be omitted:

Event::create()  ->organizer('ruben@spatie.be', 'Ruben')  ...

Attendees of an event can be added as such

Event::create()  ->attendee('ruben@spatie.be') // only an email address is required  ->attendee('brent@spatie.be', 'Brent')  ...

You can also set the participation status of an attendee:

Event::create()  ->attendee('ruben@spatie.be', 'Ruben', ParticipationStatus::accepted())  ...

There are three participation statuses:

  • ParticipationStatus::accepted()
  • ParticipationStatus::declined()
  • ParticipationStatus::tentative()

An event can be made transparent, so it does not overlap visually with other events in a calendar:

Event::create()  ->transparent()  ...

After creating your event, it should be added to a calendar. There are multiple options to do this:

// As a single event parameter $event = Event::create('Creating calendar feeds');  Calendar::create('Laracon Online')  ->event($event)  ...  // As an array of events Calendar::create('Laracon Online')  ->event([  Event::create('Creating calender feeds'),  Event::create('Creating contact lists'),  ])  ...    // As a closure Calendar::create('Laracon Online')  ->event(function(Event $event){  $event->name('Creating calender feeds');  })  ...

Using Carbon

Since this package expects a DateTimeInterface for properties related to date and time, it is possible to use the popular Carbon library:

use Carbon\Carbon;  Event::create('Laracon Online')  ->startsAt(Carbon::now())  ...

Timezones

By default, events will not use timezones. This means an event like noon at 12 o’clock will be shown for someone in New York at a different time than for someone in Sydney.

If you want to show an event at the exact time it is happening, for example, a talk at an online conference streamed around the world. Then you should consider using timezones.

This package relies on the timezones provided by PHP DateTime if you want to include these timezones in an event you can do the following:

$starts = new DateTime('6 march 2019 15:00', new DateTimeZone('Europe/Brussels'))  Event::create()  ->startsAt($starts)  ->withTimezone()  ...

Want timezones in each event of the calendar, then add withTimezones to your Calendar:

Calendar::create()  ->withTimezone()  ....

Alerts

Alerts allow calendar clients to send reminders about specific events. For example, Apple Mail on an iPhone will send users a notification about the event. An alert always belongs to an event and has a description and the number of minutes before the event it will be triggered:

Event::create('Laracon Online')  ->alertMinutesBefore(5, 'Laracon online is going to start in five mintutes');

You can also trigger an alert after the event:

Event::create('Laracon Online')  ->alertMinutesAfter(5, 'Laracon online has ended, see you next year!');

Or trigger an alert on a specific date:

Event::create('Laracon Online')  ->alert(Alert::date(  new DateTime('05/16/2020 12:00:00'),  'Laracon online has ended, see you next year!'  ))

Use with Laravel

You can use Laravel Responses to stream to calendar applications:

$calendar = Calendar::create('Laracon Online');  response($calendar->get())  ->header('Content-Type', 'text/calendar')  ->header('charset', 'utf-8');

If you want to add the possibility for users to download a calendar and import it into a calendar application:

$calendar = Calendar::create('Laracon Online');  response($calendar->get())  ->header('Content-Type', 'text/calendar')  ->header('charset', 'utf-8')  ->download('my-awesome-calendar.ics');

Extending the package

We try to keep this package as straightforward as possible. That’s why a lot of properties and subcomponents from the RFC are not included in this package. We’ve made it possible to add other properties or subcomponents to each component in case you might need something not included in the package. But be careful! From this moment, you’re on your own correctly implementing the RFC’s.

Appending properties

You can add a new property to a component like this:

Calendar::create()  ->appendProperty(  TextPropertyType::create('ORGANIZER', 'ruben@spatie.be')  )  ...

Here we’ve added a TextPropertyType, and this is a default key-value property type with a text as value. You can also use the DateTimePropertyType, the DurationPropertyType or create your own by extending the PropertyType class.

Sometimes a property can have some additional parameters, these are key-value entries and can be added to properties as such:

$property = TextPropertyType::create('ORGANIZER', 'ruben@spatie.be')  ->addParameter(Parameter::create('CN', 'RUBEN VAN ASSCHE'));  Calendar::create()  ->appendProperty($property)  ...

Appending subcomponents

A subcomponent can be appended as such:

Calendar::create()  ->appendSubComponent(  Event::create('Extending icalendar-generator')  )  ...

It is possible to create your subcomponents by extending the Component class.

Testing

Alternatives

We strive for a simple and easy to use API, want something more? Then check out this package by markus poerschke.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.

Postcardware

You’re free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

Support us

Spatie is a webdesign agency based in Antwerp, Belgium. You’ll find an overview of all our open source projects on our website.

Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

License

The MIT License (MIT). Please see License File for more information.

programming

via Laravel News Links https://ift.tt/2dvygAJ

January 29, 2020 at 09:51AM

Hick Farmers Retaliate Against Coastal Elites By Withholding Ingredients Needed To Make Avocado Toast

Hick Farmers Retaliate Against Coastal Elites By Withholding Ingredients Needed To Make Avocado Toast

https://ift.tt/3130DOq

Hick Farmers Retaliate Against Coastal Elites By Withholding Ingredients Needed To Make Avocado Toast

U.S.—Farmers have long been looked down upon by coastal elites, and now the farmers are finally getting their revenge: the “redneck hicks” all around the country have announced they will not be shipping the ingredients needed to make avocado toast to major liberal cities like New York and Los Angeles.

“Until further notice, you’ll have to farm your own wheat and grow your own avocados,” a spokesperson for America’s farmers said as he chewed on a stalk of Timothy grass and did other stereotypical farmer things. “Have fun! Yeehaw!”

Avocado farmers in rural parts of Florida and California reminded city dwellers just how juicy and delicious their avocados are. “Man, these are just perfect — would go great on a nice, warm piece of toast. It would be a real shame if I didn’t ship these to the cities, since I’m just a hick farmer and all.”

The coastal elites were devastated by the sanctions, as the only thing they know how to grow is marijuana in their parents’ basement.

“Nooooo!!!” screamed one Hollywood screenwriter as his assistant nervously informed him there would be no avocado toast with his latte this morning. “I can’t even!”

CNN’s Don Lemon wrote a formal apology to the farmers, but they claimed they couldn’t read it and so the sanctions would continue.

Breaking: Paypal Now Available

Many of you told us you wouldn’t subscribe until we offered Paypal as a payment option. You apparently weren’t bluffing, so we finally caved and added Paypal. Now — like the unbeliever faced with God’s invisible qualities displayed in nature — you are without excuse.

fun

via The Babylon Bee https://babylonbee.com

January 29, 2020 at 01:23PM

Best PhpStorm settings after 8 years of use

Best PhpStorm settings after 8 years of use

https://ift.tt/2NvMio2

It’s been a long time. I’ve been using PhpStorm for almost 8 years now. More precisely from 2012. Version 3 back then. A lot has happened in that time. A lot has changed. Of course, you learn more and more every day. This article is the result of my 8 years of experience with PhpStorm and my best settings that make you a faster developer and let you focus more on the important things.

If you don’t care about the exact settings and what they are used for, you can download my snapshot (including my personal GitHub and Material Theme) and just import it into PhpStorm via File > Import Settings. Just scroll to the end of this post and you’ll find anything you need.

My Best Settings

I’ll show you only the settings you’ve to change that are different from the default. Either I’m gonna show you a [ ] for unselect or [x] for select.

General

Hide everything you don’t need.

View > Appearance

  • [ ] Toolbar
  • [ ] Tool Window Bars
  • [ ] Status Bar
  • [ ] Navigation bar

Settings

Appearance & Behaviour > Appearance

  • [ ] Animate windows
    Doesn’t improve anything but decreases performance
  • [x] Show memory indicator
    If you are using the status bar to give you better insights into your memory usage
  • [ ] Show tool window bars
    Removes some more bars
  • [ ] Show tool window numbers
    Removes some more bars

Appearance & Behaviour > System Settings

  • [ ] Reopen last project on startup
    I work on several projects, so I want to choose which project should be opened at the beginning
  • [ ] Confirm application exit
    If I want to exit the application it just should close without any confirmation
  • [x] Open project in new window
    PhpStorm gives you the possibility to open a project in the same window as the current one. This is in 99% not the thing you want.

Appearance & Behaviour > File Colors

  • [ ] Enable File Colors
  • [ ] Use in Editor Tabs
  • [ ] Use in Project View

Maybe you like it or not. I don’t. These options remove the file colors and background colors from the tabs and project tree for some special folders like node_modules or tests.

Keymap

I just changed some of the keymaps. Basically I’m using the default ones.

  • Ctrl + V Split Vertically
  • Ctrl + H Split Horizontally
  • Cmd + T Run…
    If you are in a test file you just press this keymap within a method and then this method will be tested.
  • Shift + Cmd + T Run
    This keymap can be used anywhere in the application. It just runs that last test again.
  • Ctrl + W Hide Active Tool Window
    When you run tests, the test window opens. If you’re using the terminal in PhpStorm, this can be useful too. With this shortcut, you can close that at any time.
  • Cmd + 2 Select in Project View
    You might now know this. With Cmd + 1 you can toggle the sidebar. What I still often need is to jump into the sidebar project tree. I often use Shift + Shift that lets you search for everything or Cmd + O to search for classes. So I never use the sidebar. But if you would like to jump into that with the file that is currently open, this shortcut is awesome.

Editor > General

  • [ ] Enable Drag'n'Drop functionaliy in editor
    This option actually sucks. If you don’t disable it, you can move code around with your mouse which quite often happens, even if you don’t want it.
  • [ ] Show notification after reformat code action
  • [ ] Show notification after optimize imports action
  • [x] Soft-wrap-files
    This is a very cool functionality. When you edit for instance markdown files, lines never wrap. With this option, you can change that. They wrap now.
  • Strip trailing spaces on Save: All
    This one strips all trailing spaces on every single save command (PhpStorm saves automatically if you don’t use tabs)
  • [ ] Always keep trailing spaces on caret line
  • [x] Ensure line feed at file end on save
    With this option, your file is guaranteed to have an empty line at the end of the file.

Editor > General > Appearance

  • [ ] Show hard wrap and visual guides
  • [ ] Show code lens on scrollbar hover
    This removes the “preview” of the code when you hover at a specific position on the scrollbar

Editor > General > Breadcrumbs

  • [ ] Show Breadcrumbs
    We don’t need breadcrumbs. So let’s disable it. We love clean UIs.

Editor > General > Code Completion

  • [x] Show full method signatures
    We want to see everything when code completion for methods starts

Editor > General > Code Folding

Personally, I don’t like any code folding, because I would like to see what I edit.

  • [ ] Show coding folding outline
  • [ ] File header
  • [ ] Imports
  • [ ] HTML 'style' attribute
  • [ ] XML entities
  • [ ] Data URIs
  • [ ] Imports

Editor > General > Editor Tabs

If you are not used to having any tabs I can highly recommend it. You can always the shortcut Cmd + E to get the recent files and Shift + Shift to search for any other file. There is no need for tabs.

Editor > General > Smart Keys > PHP

  • [ ] Enable smart function parameters completion
  • [ ] Select variable name without '$' sign on double click
    If I double click on a variable, I don’t want it to select the ‘$’, that’s why I disable it.

Editor > General > Font

This is very personal and up your own preference. This fits best for me.

  • Font: Menlo
  • Size: 15
  • Line spacing: 1.9

Editor > General > Color Scheme > General

If you’re like me and you don’t want all these method separators, you can disable them. What you can’t disable yet are the separators for the imported use statements. But there is a workaround. Just unset the foreground color for the following entry.

  • [ ] Method separator color, Foreground

Editor > General > Code Style

  • Line Seperator: Unix and macOS

Editor > General > Inspections

You might be wondering why I don’t say anything here. Listing the inspections is pretty elaborate. I’ve made a few adjustments here specific to Laravel. So you have a clean environment without those annoying underlings. My Inspections can also be found in the download package. If you have any questions, let me know.

Editor > General > Inlay Hints

  • [ ] Show hints for:
    I don’t need this.

Languages & Frameworks > PHP > Debug

  • [ ] Force break at first line when no path mapping specified
  • [ ] Force break at first line when a script is outside the project

You should untick both when using Laravel Valet. Otherwise, xdebug starts debugging in Valet itself.

Tools > Web Browsers

  • [ ] Show browsers popup in the editor
    Do you remember this little preview with browser icons all the time? You can disable it.

Conclusion

The result is a very clean and intuitive IDE that remembers of Sublime with the only difference that it’s a fully integrated IDE. You can download my complete PhpStorm settings package. Just import into PhpStorm via File > Import Settings

What’s included?

This package contains also my customized GitHub Theme and customized Material Theme. My Material Theme is not that colorful as the original is. That makes it cleaner and you can focus more. As a bonus there is a Laravel specific inspections rule included. If you don’t use it, most of the time everything is underscored with orange or red lines because of Laravels Facade architecture, it’s hard for the IDE to follow everything along.

I am very interested in whether I have forgotten something? Or if you have any other practical tips to help me make PhpStorm even better. Let me know.

programming

via Laravel News Links https://ift.tt/2dvygAJ

January 29, 2020 at 11:51AM

Surprise: The Space Force Logo is Not a Rip-Off of the Star Trek Logo

Surprise: The Space Force Logo is Not a Rip-Off of the Star Trek Logo

https://ift.tt/3aMWWRu

After President Trump Tweeted this on Friday…

…the internet erupted with outrage (of course), stating that the new Space Force logo was a rip-off of the StarFleet Command United Federation of Planets logo used in the Star Trek franchise. Here they are side-by-side:

The truth isn’t so simple. The Space Force logo is an evolution of the Air Force Space Command logo, its predecessor. And as SlashGear points out, that earlier logo was designed way back in 1982:

The Starfleet logo everyone’s pointing to? That was designed by Star Trek designer Michael Okuda…in 1996, first appearing in the Deep Space Nine series.

Ex Astris Scientia quotes Okuda as reporting that his 1996 design "was intended to be somewhat reminiscent of the NASA emblem" of the era:

The larger question: Why does the Space Force get people so worked up and ready to hate it? I’m guessing it’s because our President announced it with all of the gravitas of introducing a new Doritos flavor.

fun

via Core77 https://ift.tt/1KCdCI5

January 27, 2020 at 11:44AM

Making a Giant X-Acto Blade

Making a Giant X-Acto Blade

https://ift.tt/30YUoLr

Making a Giant X-Acto Blade

Link

Ever since seeing The Sword of Exact Zero in The LEGO Movie, swordsmith Michael Cthulhu has contemplated making a larger-than-life X-Acto knife blade. With a sponsor in hand for his video, he finally took the time to make his cutting tool for giants a reality. He’s auctioning it off for charity to help save animals from Australia’s fires.

fun

via The Awesomer https://theawesomer.com

January 27, 2020 at 12:43PM

The Ultimate JavaScript Cheat Sheet

The Ultimate JavaScript Cheat Sheet

https://ift.tt/38BrWSD

Code displayed on a laptop screen

If you want to build dynamic webpages, you’ll have to supplement your HTML and CSS knowledge with an understanding of JavaScript. This scripting language is considered an essential in modern web development.

You can build all kinds of interesting interactive apps and websites with JavaScript, but there’s much to learn on the way. With that in mind, we have created the following JavaScript cheat sheet for you.

The cheat sheet can serve as a quick refresher on JavaScript elements any time you need one. It’s handy for newbies and experts alike.

FREE DOWNLOAD: This cheat sheet is available as a downloadable PDF from our distribution partner, TradePub. You will have to complete a short form to access it for the first time only. Download The Ultimate JavaScript Cheat Sheet.

The Ultimate JavaScript Cheat Sheet

Shortcut Action
JavaScript Arrays
concat() Join several arrays into one
copyWithin() Copy array elements within the array, to and from specified positions
indexOf() Return the primitive value of the specified object
includes() Check if an array contains the specified element
join() Combine elements of an array into a single string and return the string
entries() Return a key/value pair Array Iteration Object
every() Check if every element in an array passes a test
fill() Fill the elements in an array with a static value
filter() Create a new array with every element in an array that pass a test
find() Return the value of the first element in an array that pass a test
forEach() Call a function for each array element
from() Create an array from an object
lastIndexOf() Give the last position at which a given element appears in an array
pop() Remove the last element of an array
push() Add a new element at the end
reverse() Sort elements in descending order
reduce() Reduce the values of an array to a single value (going left-to-right)
reduceRight() Reduce the values of an array to a single value (going right-to-left)
shift() Remove the first element of an array
slice() Pull a copy of a portion of an array into a new array object
sort() Sort elements alphabetically
splice() Add elements in a specified way and position
unshift() Add a new element to the beginning
JavaScript Boolean Methods
toString() Convert a Boolean value to a string, and return the result
valueOf() Return the first position at which a given element appears in an array
toSource() Return a string representing the source code of the object
JavaScript Arithmetic Operators
+ Addition
Subtraction
* Multiplication
/ Division
(…) Grouping operator (operations within brackets are executed earlier than those outside)
% Modulus (remainder)
++ Increment numbers
Decrement numbers
== Equal to
=== Equal value and equal type
!= Not equal
!== Not equal value or not equal type
> Greater than
Lesser than
>= Greater than or equal to
<= Lesser than or equal to
? Ternary operator
Logical Operators
&& Logical AND
|| Logical OR
! Logical NOT
Bitwise Operators
& AND statement
| OR statement
~ NOT
^ XOR
Left shift
>> Right shift
>>> Zero fill right shift
Functions
alert() Output data in an alert box in the browser window
confirm() Open up a yes/no dialog and return true/false depending on user click
console.log() Write information to the browser console (good for debugging purposes)
document.write() Write directly to the HTML document
prompt() Create a dialog for user input
Global Functions
decodeURI() Decode a Uniform Resource Identifier (URI) created by encodeURI or similar
decodeURIComponent() Decode a URI component
encodeURI() Encode a URI into UTF-8
encodeURIComponent() Same but for URI components
eval() Evaluate JavaScript code represented as a string
isFinite() Determine whether a passed value is a finite number
isNaN() Determine whether a value is an illegal number
Number() Convert an object’s value to a number
parseFloat() Parse a string and return a floating point number
parseInt() Parse a string and return an integer
JavaScript Loops
for The most common way to create a loop in JavaScript
while Set up conditions under which a loop executes
do while Similar to the while loop, however, it executes at least once and performs a check at the end to see if the condition is met to execute again
break Stop and exit the cycle if certain conditions are mets
continue Skip parts of the cycle if certain conditions are met
Escape Characters
\’ Single quote
\" Double quote
\\ Backslash
\b Backspace
\f Form feed
\n New line
\r Carriage return
\t Horizontal tabulator
\v Vertical tabulator
JavaScript String Methods
charAt() Return a character at a specified position inside a string
charCodeAt() Give the unicode of character at that position
concat() Concatenate (join) two or more strings into one
fromCharCode() Return a string created from the specified sequence of UTF-16 code units
indexOf() Provide the position of the first occurrence of specified text within a string
lastIndexOf() Same as indexOf() but with the last occurrence, searching backwards
match() Retrieve the matches of a string against a search pattern
replace() Find and replace specified text in a string
search() Execute a search for a matching text and return its position
slice() Extract a section of a string and return it as a new string
split() Split a string object into an array of strings at a specified position
startsWith() Check whether a string begins with specified characters
substr() Similar to slice() but extracts a substring depended on a specified number of characters
substring() Similar to slice() but can’t accept negative indices
toLowerCase() Convert strings to lower case
toUpperCase() Convert strings to upper case
valueOf() Return the primitive value (that has no properties or methods) of a string object
REGULAR EXPRESSION SYNTAX

Pattern Modifiers

e Evaluate replacement
i Perform case-insensitive matching
g Perform global matching
m Perform multiple line matching
s Treat strings as single line
x Allow comments and whitespace in pattern
U Ungreedy pattern
Brackets
[abc] Find any of the characters in the brackets
[^abc] Find any character not in the brackets
[0-9] Find digit specified in the brackets
[A-z] Find any character from uppercase A to lowercase z
(a|b|c) Find any of the alternatives separated with |
Metacharacters
. Find a single character, except newline or line terminator
\w Word character
\W Non-word character
\d A digit
\D A non-digit character
\s Whitespace character
\S Non-whitespace character
\b Find a match at the beginning/end of a word
\B Find a match not at the beginning/end of a word
\u0000 NUL character
\n A new line character
\f Form feed character
\r Carriage return character
\t Tab character
\v Vertical tab character
\xxx Character specified by an octal number xxx
\xdd Latin character specified by a hexadecimal number dd
\udddd Unicode character specified by a hexadecimal number dddd
Quantifiers
n+ Match any string that contains at least one n
n* Any string that contains zero or more occurrences of n
n? Any string that contains zero or one occurrences of n
n{X} Any string that contains a sequence of X n’s
n{X,Y} Strings that contains a sequence of X to Y n’s
n{X,} Matches any string that contains a sequence of at least X n’s
n$ Any string with n at the end of it
^n String with n at the beginning of it
?=n Any string that is followed by a specific string n
?!n String that is not followed by a specific string n
Number Properties
MAX_VALUE Maximum numeric value representable in JavaScript
MIN_VALUE Smallest positive numeric value representable in JavaScript
NaN The “Not-a-Number” value
NEGATIVE_INFINITY Negative Infinity value
POSITIVE_INFINITY Positive Infinity value
Number Methods
toExponential() Return a string with a rounded number written as exponential notation
toFixed() Return string of a number with a specified number of decimals
toPrecision() Return string of a number written with a specified length
toString() Return a number as a string
valueOf() Return a number as a number
Math Properties
E Euler’s number
LN2 Natural logarithm of 2
LN10 Natural logarithm of 10
LOG2E Base 2 logarithm of E
LOG10E Base 10 logarithm of E
PI The number PI
SQRT1_2 Square root of 1/2
SQRT2 Square root of 2
Math Methods
abs(x) Return the absolute (positive) value of x
acos(x) Arccosine of x, in radians
asin(x) Arcsine of x, in radians
atan(x) Arctangent of x as a numeric value
atan2(y,x) Arctangent of the quotient of its arguments
ceil(x) Value of x rounded up to its nearest integer
cos(x) Cosine of x (x is in radians)
exp(x) Value of Ex
floor(x) Value of x rounded down to its nearest integer
log(x) Natural logarithm (base E) of x
max(x,y,z,…,n) Number with highest value
min(x,y,z,…,n) Number with lowest value
pow(x,y) X to the power of y
random() Random number between 0 and 1
round(x) Value of x rounded to its nearest integer
sin(x) Sine of x (x is in radians)
sqrt(x) Square root of x
tan(x) Tangent of an angle
Dates
Date() Create a new date object with the current date and time
Date(2017, 5, 21, 3, 23, 10, 0) Create a custom date object. The numbers represent year, month, day, hour, minutes, seconds, milliseconds. You can omit anything you want except for year and month.
Date(“2017-06-23”) Date declaration as a string
getDate() Get the day of the month as a number (1-31)
getDay() Get the weekday as a number (0-6)
getFullYear() Get the year as a four digit number (yyyy)
getHours() Get the hour (0-23)
getMilliseconds() Get the millisecond (0-999)
getMinutes() Get the minute (0-59)
getMonth() Get the month as a number (0-11)
getSeconds() Get the second (0-59)
getTime() Get the time (milliseconds since January 1, 1970)
getUTCDate() Day (date) of the month in the specified date according to universal time (also available for day, month, fullyear, hours, minutes etc.)
parse Parse a string representation of a date, and return the number of milliseconds since January 1, 1970
setDate() Set the day as a number (1-31)
setFullYear() Set the year (optionally month and day)
setHours() Set the hour (0-23)
setMilliseconds() Set the milliseconds (0-999)
setMinutes() Set the minutes (0-59)
setMonth() Set the month (0-11)
setSeconds() Set the seconds (0-59)
setTime() Set the time (milliseconds since January 1, 1970)
setUTCDate() Set the day of the month for a specified date according to universal time (also available for day, month, fullyear, hours, minutes etc.)
DOM MODE


Node Properties

attributes Live collection of all attributes registered to an element
baseURI Absolute base URL of an HTML element
childNodes Collection of an element’s child nodes
firstChild First child node of an element
lastChild Last child node of an element
nextSibling Next node at the same node tree level
nodeName Name of a node
nodeType Type of a node
nodeValue Value of a node
ownerDocument Top-level document object for current node
parentNode Parent node of an element
previousSibling Node immediately preceding the current one
textContent Textual content of a node and its descendants
Node Methods
appendChild() Add a new child node to an element as the last child node
cloneNode() Clone HTML element
compareDocumentPosition() Compare the document position of two elements
getFeature() Return an object which implements the APIs of a specified feature
hasAttributes() Return true if an element has any attributes, else return false
hasChildNodes() Return true if an element has any child nodes, else return false
insertBefore() Insert a new child node before a specified, existing child node
isDefaultNamespace() Return true if a specified namespaceURI is the default, else return false
isEqualNode() Check if two elements are equal
isSameNode() Check if two elements are the same node
isSupported() Return true if a specified feature is supported on the element
lookupNamespaceURI() Return the namespaceURI associated with a given node
lookupPrefix() Return a DOMString containing the prefix for a given namespaceURI, if present
normalize() Join adjacent text nodes and remove empty text nodes in an element
removeChild() Remove a child node from an element
replaceChild() Replace a child node in an element
Element Methods
getAttribute() Return the specified attribute value of an element node
getAttributeNS() Return string value of the attribute with the specified namespace and name
getAttributeNode() Get the the specified attribute node
getAttributeNodeNS() Return the attribute node for the attribute with the given namespace and name
getElementsByTagName() Provide a collection of all child elements with the specified tag name
getElementsByTagNameNS() Return a live HTML collection of elements with a certain tag name belonging to the given namespace
hasAttribute() Return true if an element has any attributes, else return false
hasAttributeNS() Provide a true/false value indicating whether the current element in a given namespace has the specified attribute
removeAttribute() Remove a specified attribute from an element
removeAttributeNS() Remove the specified attribute from an element within a certain namespace
removeAttributeNode() Take away a specified attribute node and return the removed node
setAttribute() Set or change the specified attribute to a specified value
setAttributeNS() Add a new attribute or change the value of an attribute with the given namespace and name
setAttributeNode() Set or change the specified attribute node
setAttributeNodeNS() Add a new namespaced attribute node to an element
Browser Window Properties
closed Check whether a window has been closed or not and return true or false
defaultStatus Set or return the default text in the statusbar of a window
document Return the document object for the window
frames Return all iframe elements in the current window
history Provide the History object for the window
innerHeight Inner height of a window’s content area
innerWidth Inner width of the content area
length Return the number of iframe elements in the window
location Return the location object for the window
name Set or return the name of a window
navigator Return the Navigator object for the window
opener Return a reference to the window that created the window
outerHeight Outer height of a window, including toolbars/scrollbars
outerWidth Outer width of a window, including toolbars/scrollbars
pageXOffset Number of pixels by which the document has been scrolled horizontally
pageYOffset Number of pixels by which the document has been scrolled vertically
parent Parent window of the current window
screen Return the Screen object for the window
screenLeft Horizontal coordinate of the window (relative to screen)
screenTop Vertical coordinate of the window
screenX Same as screenLeft but needed for some browsers
screenY Same as screenTop but needed for some browsers
self Return the current window
status Set or return the text in the statusbar of a window
top Return the topmost browser window
Browser Window Methods
alert() Display an alert box with a message and an OK button
blur() Remove focus from the current window
clearInterval() Clear a timer set with setInterval()
clearTimeout() Clear a timer set with setTimeout()
close() Close the current window
confirm() Display a dialog box with a message and OK and Cancel buttons
focus() Set focus to the current window
moveBy() Move a window relative to its current position
moveTo() Move a window to a specified position
open() Open a new browser window
print() Print the content of the current window
prompt() Display a dialog box that prompts the visitor for input
resizeBy() Resize the window by the specified number of pixels
resizeTo() Resize the window to a specified width and height
scrollBy() Scroll the document by a specified number of pixels
scrollTo() Scroll the document to specified coordinates
setInterval() Call a function or evaluate an expression at specified intervals
setTimeout() Call a function or evaluate an expression after a specified interval
stop() Stop the window from loading
Screen Properties
availHeight Return the height of the screen (excluding the Windows Taskbar)
availWidth Return the width of the screen (excluding the Windows Taskbar)
colorDepth Return the bit depth of the color palette for displaying images
height The total height of the screen
pixelDepth The color resolution of the screen in bits per pixel
width The total width of the screen
JAVASCRIPT EVENTS

JavaScript Mouse Events

onclick When user clicks on an element
oncontextmenu When user right-clicks on an element to open a context menu
ondblclick When user double-clicks on an element
onmousedown When user presses a mouse button over an element
onmouseenter When user moves pointer onto an element
onmouseleave When user moves pointer away from an element
onmousemove When user moves pointer while it is over an element
onmouseover When user moves pointer onto an element or one of its children
onmouseout When user moves pointer away from an element or one of its children
onmouseup When user releases a mouse button while over an element
JavaScript Keyboard Events
onkeydown When user is pressing a key down
onkeypress When user starts pressing a key
onkeyup When user releases a key
JavaScript Frame Events
onabort When loading of media is aborted
onbeforeunload Before the document is about to be unloaded
onerror When an error occurs while loading an external file
onhashchange When the anchor part of a URL has changed
onload When an object has loaded
onpagehide When user navigates away from a webpage
onpageshow When user navigates to a webpage
onresize When user resizes document view
onscroll When user is scrolling an element’s scrollbar
onunload When a page has unloaded
JavaScript Form Events
onblur When an element loses focus
onchange When the content of a form element changes (for input, select, and textarea)
onfocus When an element gets focus
onfocusin When an element is about to get focus
onfocusout When an element is about to lose focus
oninput User input on an element
oninvalid When an element is invalid
onreset When a form is reset
onsearch When a user types something in a search field (for input="search")
onselect When user selects some text (for input and textarea)
onsubmit When a form is submitted
JavaScript Drag Events
ondrag When user drags an element
ondragend When user has finished dragging the element
ondragenter When the dragged element enters a drop target
ondragleave When the dragged element leaves the drop target
ondragover When the dragged element is on top of the drop target
ondragstart When user starts to drag an element
ondrop Dragged element is dropped on the drop target
JavaScript Clipboard Events
oncopy When user copies content of an element
oncut When user cuts an element’s content
onpaste When user pastes content in an element
JavaScript Media Events
onabort When media loading is aborted
oncanplay When browser can start playing media (e.g. a file has buffered enough)
oncanplaythrough When browser can play through media without stopping
ondurationchange When duration of media changes
onended When media has reached its end
onerror When an error occurs while loading an external file
onloadeddata When media data is loaded
onloadedmetadata When metadata (like dimensions and duration) is loaded
onloadstart When browser starts looking for specified media
onpause When media is paused either by user or automatically
onplay When media has been started or is no longer paused
onplaying When media is playing after having been paused or stopped for buffering
onprogress When browser is in the process of downloading media
onratechange When playing speed of media changes
onseeked When user has finished moving/skipping to a new position in media
onseeking When user starts moving/skipping
onstalled When browser is trying to load unavailable media
onsuspend When browser is intentionally not loading media
ontimeupdate The playing position has changed (e.g. because of fast forward)
onvolumechange When media volume has changed (including mute)
onwaiting When media has paused but is expected to resume (for example, buffering)
Animation
animationend When CSS animation is complete
animationiteration When CSS animation is repeated
animationstart When CSS animation has started
Miscellaneous
transitionend When CSS transition is complete
onmessage When a message is received through the event source
onoffline When browser starts to work offline
ononline When browser starts to work online
onpopstate When the window’s history changes
onshow When a menu element is shown as a context menu
onstorage When a Web Storage area is updated
ontoggle When user opens or closes the details element
onwheel When mouse wheel rolls up or down over an element
ontouchcancel When screen touch is interrupted
ontouchend When user’s finger goes off touch screen
ontouchmove When user drags a finger across the screen

Explore JavaScript Further

We consider JavaScript one of the top programming languages to master for the future. And we recommend diving into advanced concepts like JavaScript array methods once you have a grasp of the basics of JavaScript.

Image Credit: Oskar Yildiz on Unsplash

Read the full article: The Ultimate JavaScript Cheat Sheet

non critical

via MakeUseOf.com https://ift.tt/1AUAxdL

January 25, 2020 at 06:57PM

Ecommerce Security: 10 Tips for Your Online Store

Ecommerce Security: 10 Tips for Your Online Store

https://ift.tt/3b1es3H

Featured image by 3D Animation Production Company from Pixabay 

Ecommerce has changed the way consumers shop. No longer does the traditional brick-and-mortar store reign supreme. Instead, online stores, by offering shopping convenience all day and all night every single day of the year, lure customers to their sites from all over the world. And as ecommerce sales continue to swell, the necessity of better ecommerce security grows more urgent.

There Is a Growing Demand for Ecommerce

According to reports from Statista, ecommerce sales are expected to reach $4.5 trillion by 2021. Moreover, retail commerce sales across the Asia-Pacific region are set to be greater than those in the rest of the world by 2023.

There are many reasons why this is so. For example, with an ecommerce store you can reach a global audience, even if your marketing budget is limited. Additionally, ecommerce stores don’t have the overhead expenses their brick-and-mortar counterparts have. Therefore, an entrepreneur can start an ecommerce business with only a small investment.

As a result, buyers can enjoy easily exploring millions of products on their phones and other devices.

Let’s not forget that ecommerce provides plenty of opportunities for landbased businesses as well, however. Both small and midsize businesses can boost their sales prospects by adding an ecommerce aspect to their portfolios.

However, every ecommerce site is vulnerable to security breaches and cyberattacks. Hackers lie in wait, eager to steal sensitive information. Therefore, while store design, functionality, and shopping convenience are important, online stores of all stripes need to prioritize ecommerce security features.

RELATED ARTICLE: WHICH CYBER SECURITY PROCESS IS RIGHT FOR YOUR BUSINESS?

Below are some important security tips for your ecommerce site:

1. Choose the Right Ecommerce Platform

Many ecommerce store owners establish their stores on platforms such as Magento and Shopify. This is not surprising, since these platforms offer excellent ecommerce security features.

Among your top considerations while selecting an ecommerce platform must be robust functionality, convenience, and security. Once these aspects are handled, you will be able to focus on your core business.

Ecommerce platforms such as Shopify may have the best ecommerce security features. However, even if you choose this platform for your site, you will still need to remain aware of other security measures and take action as necessary.

Rest assured, however, that most ecommerce platforms have secure payment gateways and convenient shipping methods, as well as high-level security features such as automatic security updates.

2. Switch to HTTPS for Better Ecommerce Security

Your ecommerce site must have an SSL certificate such as Comodo PositiveSSL Wildcard. When you do, your site’s URL will begin with HTTPS instead of HTTP. An SSL certificate provides protocols that encrypt sensitive information such as customers’ credit card information, user names, and passwords.

HTTPS represents the standard for ensuring security of ecommerce websites and other sites that deal with sensitive information. In fact, Google ranks sites with the HTTPS designation higher than web pages that lack it.

For example, SSL certificates such as Comodo PositiveSSL Wildcard enable you to secure multiple sub domains at affordable prices and easy installation. Moreover, enrollment provides a 256-bit SSL encryption.

3. Set up Strong Password Rules

In order to safeguard your website’s security and ensure customer information is safe from intruders, set up rules for strong customer passwords. For example, require the use of mixed cases, numbers, and special characters.

You might even want to offer your customers a two-factor authentication system to ensure greater ecommerce security.

4. Have a Data Backup Plan

Every ecommerce website must have a robust data recovery plan. Such a plan will necessarily include regular data backups. An effective plan can help to prevent the loss of vital data related to your business and your customers.

Therefore, be sure to discuss data recovery plans with your host provider. In this way, you will know what you need to do whenever you have a server failure. This is essential for maintaining security for your ecommerce site

5. Use Security Plug-ins for Better Ecommerce Security

It may be helpful to use plugins to add additional layers of security to your ecommerce site.

For example, Wordfence Security is a plugin that integrates a solid security system in your ecommerce store by way of a web application firewall. It offers real-time insights on traffic and prevents potential hacking attempts.

6. Don’t Store Credit Card Numbers

Some ecommerce platforms provide negligent security. For example, some offer offline credit card processing as a standard option for their customers’ payments.

This option stores customers’ credit card details without encryption. This allows the card to be processed manually, which means this mechanism is not safe. If this is what you’re offering your customers, you are putting your customers’ personal information at risk.

Instead, use a payment gateway provider to keep payments safe. Above all, do not store credit card numbers at all. Also, use PCI DSS accreditation to reduce credit card payment fraud and lead to better security on your ecommerce site.

7. Monitor Your Site Effectively

Of course, you have automatic backups and firewalls to ensure security of your ecommerce website. But it’s even more important to check your website code regularly for security issues. So scan all of your site’s code regularly to detect malware.

Keep in mind, too, that content delivery networks (CDN’s) have sets of servers that store copies of website pages. They can help to prevent DDOS attacks, which can significantly interfere with your business and harm your store.

8. Install a Bot Detection Mechanism

More than half of the traffic that comes to your ecommerce website is not genuine. In fact, much of it poses a security threat.

Sometimes bot traffic may be used by competitors to gain an edge over your business. But it’s safe to assume that most bot traffic is directed with malicious intent.

Therefore, you need to have a bot detection system in place. Such a system will have analytics tools for monitoring the source of traffic to and from your site.

9. Conduct Vulnerability Tests on Your Website

It’s a good idea to conduct regular vulnerability scans on your ecommerce website to detect security risks. There are various tools available that will allow you to do this.

Choose a program that will scan both your website and the network so you can understand the associated risks and issues.

10. Schedule Automatic Backups for Better Ecommerce Security

No matter which content management system (CMS) you are using for your ecommerce website, it’s necessary to keep it updated for better security. This will help to resolve issues, fix flaws, and prevent hacking.

Make Ecommerce Security a Priority

It is important to keep your ecommerce website secure and safe by using the best possible security measures. So stay up-to-date with the latest cyber security practices. Also, ensure your site is always backed up, and use effective encryption techniques. These measures will help to keep your ecommerce website secure.

The post Ecommerce Security: 10 Tips for Your Online Store appeared first on Business Opportunities.

business

via Business Opportunities Weblog https://ift.tt/2CJxLjg

January 24, 2020 at 04:16PM

MySQL Document Store Tutorial

MySQL Document Store Tutorial

https://ift.tt/2tExop7

When I tell people that they can use MySQL without SQL they tend to be skeptical.  But with the MySQL Document Store you can do just that with a new NoSQL API and in this case there is no structured query language.pre-FOSDEM MySQL Days (which is sold out and there is a waiting list) is my tutorial on using the Document Store.  Those in my session will be able to see how to use the MySQL Shell (mysqlsh) to connect to a MySQL server and save data without have to do the many things a DBA used to have to do in the past such as normalize data, setup relations, and several other tasks.  Plus the schema-less Document Store means you can alter your data needs without having to do an endless series of ALTER TABLES.

MySQL without SQL
MySQL Document Store let you save and retrieve data without needed the use of structured query language (SQL)

Part of the tutorial is a workbook and slides that I should be able to publish if they are well received.  And maybe a video for those who will not be able to make it to Brussels.

All opinions expressed in this blog are those of Dave Stokes who is actually amazed to find anyone else agreeing with him

technology

via Planet MySQL https://ift.tt/2iO8Ob8

January 24, 2020 at 12:05PM