Skip to content

Instantly share code, notes, and snippets.

View thesunwave's full-sized avatar
🏠
Working from home

Artur Malev thesunwave

🏠
Working from home
View GitHub Profile
@zmts
zmts / tokens.md
Last active July 7, 2024 15:23
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@royling
royling / tmux-iterm2.md
Last active April 24, 2023 19:35
tmux in iTerm2 cheatsheet
@kevinelliott
kevinelliott / 1-macOS-10.12-sierra-setup.md
Last active February 5, 2024 07:22
macOS 10.12 Sierra Setup

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

2.1.5 :027 > def flatten a
2.1.5 :028?> flat = []
2.1.5 :029?> a.each{|i| i.is_a?(Array) ? flat += flatten(i) : flat << i }
2.1.5 :030?> return flat
2.1.5 :031?> end
=> :flatten
2.1.5 :032 > flatten [1,2,[:a,:b,:c],3,4]
=> [1, 2, :a, :b, :c, 3, 4]
2.1.5 :033 >
@CyberLight
CyberLight / main.go
Last active July 7, 2023 12:54
GOLANG: Patching private fields with values
package main
import (
redis "gopkg.in/redis.v3"
"reflect"
"unsafe"
"fmt"
)
type A struct {
@artemeff
artemeff / 2015.md
Last active November 25, 2016 15:34
  • Ушел из компании мечты (фейл, пришлось), а потом ее купила Airbnb (вин);
  • Запустил второй проект на Эрланге в продакшн (трекер общественного транспорта, щас он уже все);
  • Для этого проекта на Эрланге сделал красивое приложение для Windows Phone в продакшн (прям качали с магазина);
  • Затащил лучшего друга в программирование, всячески ему помогал и сейчас он уже на зарплате;
  • Затащил этот проект с трекингом транспорта в дипломную и защитил на отлично, закончил универ;
  • Попал в сильную команду рубистов, там немного научили в DDD и поставили на путь, куда идти дальше в ООП;
  • Попал в другую сильную команду рубистов, где хорошо прокачал теорию и практику распределенных систем;
  • Возненавидел тех, кто использует Elasticsearch не по назначению (никогда в жизни не устану это повторять, это травма);
  • Прокачался во фронтенде (react, babel и все такое модное с БД на клиенте и иммутабельными стейтами);
  • Попал в команду ROM, написал два адаптера в продакшн (rom-elasticsearch, rom-redis) и один для себя (rom-rethin
@wosephjeber
wosephjeber / ngrok-installation.md
Last active June 4, 2024 07:48
Installing ngrok on Mac

Installing ngrok on OSX

For Homebrew v2.6.x and below:

brew cask install ngrok

For Homebrew v2.7.x and above:

@imjasonh
imjasonh / markdown.css
Last active May 24, 2024 22:56
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@gbuesing
gbuesing / ml-ruby.md
Last active February 28, 2024 15:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems

@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/