Skip to content

Instantly share code, notes, and snippets.

View Y-Taras's full-sized avatar
🏠
Working from home

Taras Yaremkiv Y-Taras

🏠
Working from home
  • Ukraine, Ivano-Frankivsk
View GitHub Profile
@mircohacker
mircohacker / release.yaml
Created April 30, 2020 08:13
Push to Github Pages with Github Actions
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
* Inheritance 2. Polymorphism 3. Abstraction 4. Encaptulation
* Polymorphism --> Method OverLoading Method Overriding
* Method Overriding Rules:
a). public private protected modifier
class Parent
{
protected Parent get() throws IOException
{
return null;
}
@rauschma
rauschma / _private-fields-faq.md
Last active April 10, 2018 22:07
Fields with arbitrarily scoped privacy

Fields with arbitrarily scoped privacy

Info on private fields: http://2ality.com/2017/07/class-fields.html

Q&A

  • Why the prefix #?
    • You define keys and these keys additionally work completely differently from property keys.
  • Is the keyword private necessary?
  • It could be omitted (first mention declares), but I like the distinction between declaration and mention.
@shivamkr19
shivamkr19 / download-egghead-io-videos.md
Last active February 4, 2022 09:48
Download free egghead.io videos

Download free egghead.io videos

Download Egghead.io videos using Lynx Browser and youtube-dl. This method will only work for videos that do not require a pro account.

Prerequesits

You need a Unix/Linux box with Lynx console browser and Youtube-dl installed.

@ljharb
ljharb / array_iteration_thoughts.md
Last active April 29, 2024 17:13
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

@carcinocron
carcinocron / debugger pause beforeunload
Last active April 25, 2024 16:48
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@chantastic
chantastic / gulpfile.js
Last active October 13, 2023 03:20
This a script for a Full Stack Talk, given 3/13/14. Feel free to follow along at your own pace.
var gulp = require('gulp');
var coffee = require('gulp-coffee');
gulp.task('scripts', function () {
gulp.src('src/*.coffee')
.pipe(coffee())
.pipe(gulp.dest('./'));
});
gulp.task('watch', function () {
@cobyism
cobyism / gh-pages-deploy.md
Last active May 3, 2024 19:07
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).