Skip to content

Instantly share code, notes, and snippets.

View uran1980's full-sized avatar

Ivan Yakovlev uran1980

View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active July 25, 2024 09:00
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@uran1980
uran1980 / jquery.debonce.js
Last active January 21, 2018 17:24
jquery.debonce.js
/**
* @see https://stackoverflow.com/questions/28948383/how-to-implement-debounce-fn-into-jquery-keyup-event
* @see http://jsfiddle.net/bjb9s2w5/
* @see https://learn.jquery.com/plugins/basic-plugin-creation/
*
* Usage:
*
* ```
* $('input').on('keyup', $.fn.debonce(function () {
* // do some ajax request...
@zkat
zkat / index.js
Last active July 8, 2024 04:39
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@samueljseay
samueljseay / es6-import-cheat-sheet.md
Created June 2, 2017 02:35
ES6 exports / imports cheat sheet
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
@zmts
zmts / tokens.md
Last active July 28, 2024 08:03
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
let webpack = require('webpack');
let path = require('path');
module.exports = {
entry: {
app: './resources/assets/js/app.js',
vendor: ['vue', 'axios']
},
output: {
@swaldman
swaldman / GethAsAService.md
Last active October 9, 2022 02:18
Setting up geth as a service under systemd (Updated for Fedora 27)

Setting up geth as a service under systemd Fedora 27

Prerequisite: dnf install golang

  1. Create user geth with useradd
  2. As user geth fast sync the blockchain, geth --fast --cache 1024
  3. Manually run geth --rpc as user geth and watch to see that the blockchain continues to sync properly
  4. Install the geth.service file (also in this gist) in /usr/lib/systemd/system/
  5. Make a symlink from /etc/systemd/system/multi-user.target.wants/geth.service to /usr/lib/systemd/system/geth.service
  6. systemctl enable geth followed by systemctl start geth
@uran1980
uran1980 / sass-convert_from-sass-to-scss.sh
Last active September 21, 2018 19:12 — forked from atelierbram/sass-convert_from-sass-to-scss.sh
Convert .sass syntax to .scss in terminal
# http://blog.teamtreehouse.com/the-absolute-beginners-guide-to-sass
# Enter the folder you want to convert in your terminal and type in:
# ---------------------------------------------------------------------
# sudo apt get install ruby-sass
# ---------------------------------------------------------------------
sass-convert --from sass --to scss -R .
# where -R means recursively and . means the current directory.
@dmnsgn
dmnsgn / SingletonEnforcer.js
Created April 16, 2016 17:43
ES6 singleton pattern: use Symbol to ensure singularity
// http://stackoverflow.com/a/26227662/1527470
const singleton = Symbol();
const singletonEnforcer = Symbol();
class SingletonEnforcer {
constructor(enforcer) {
if (enforcer !== singletonEnforcer) {
throw new Error('Cannot construct singleton');
}