Skip to content

Instantly share code, notes, and snippets.

View liamka's full-sized avatar
💭
Busy

Rasmus Kotikov liamka

💭
Busy
View GitHub Profile
@zmts
zmts / tokens.md
Last active April 25, 2024 15:23
Про токены, 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
});
}
@rndme
rndme / dict.json
Last active May 8, 2018 10:40
meaning and synonyms of common english words
var words = {
abandon: "forsake, desert",
abbey: "monastery",
able: "capable",
abolish: "get rid of",
abortion: "termination pregnancy",
abridge: "shorten, cut",
absence: "failure to be present",
absolute: "perfect or complete",
absorb: "take in, suck up",
@astf-robot
astf-robot / synonym.php
Last active May 8, 2018 10:36
Synonyms
<?php
if ($argc < 2) {
echo "Usage ${argv[0]} WORD\n";
exit(1);
}
$html = file_get_contents('http://www.thesaurus.com/browse/' . $argv[1]);
$dom = new DOMDocument();
@$dom->loadHTML($html);
@dotzero
dotzero / Random bytes, ints, UUIDs in PHP.md
Last active September 9, 2019 22:06 — forked from tom--/Random bytes, ints, UUIDs in PHP.md
PHP random bytes, integers and UUIDs

Random bytes, ints, UUIDs in PHP

Simple and safe random getters to copy-paste

string randomBytes( int $length )

int randomInt ( int $min , int $max )

string randomUuid ( void )
@matthias-chlechowitz
matthias-chlechowitz / pre-commit
Last active September 20, 2017 14:22
PreCommit-Hook
#!/bin/bash
# PHP CodeSniffer pre-commit hook for git
#
# @author Soenke Ruempler <soenke@ruempler.eu>
# @author Sebastian Kaspari <s.kaspari@googlemail.com>
#
# see the README
PHPCS_BIN=/usr/bin/phpcs
PHPCS_CODING_STANDARD=PEAR
@JohnIncog
JohnIncog / uuid.php
Last active July 16, 2023 10:09
Ints to UUID and UUID to Ints
<?php
/**
* Class to convert upto 4 integer values into a UUID string; and vice versa.
*
*/
class UUID {
/**
* @param string $UUID Universal Unique Identifier.
* @return array Containing the 4 numbers used to generate generateUUIDFromInts
*/
@jm3
jm3 / d3 audio waveforms block
Last active August 25, 2023 06:14
d3.audio.waveforms
d3 audio waveforms block
@kostia
kostia / gist:4075236
Created November 14, 2012 22:15
German synonyms for Elasticsearch
This file has been truncated, but you can view the full file.
80470 => 80470
ABC => ABC
ABM => ABM
ACL => ACL
ACPI => ACPI
ADAC => ADAC
ADSL => ADSL
AEG => AEG
AG => AG
AGP => AGP