Skip to content

Instantly share code, notes, and snippets.

View holywarez's full-sized avatar
👨‍💻

Anatoly Lapshin holywarez

👨‍💻
View GitHub Profile
@holywarez
holywarez / cheatsheet.txt
Created October 24, 2023 21:15 — forked from DNA/cheatsheet.txt
Terminal colors cheat sheet
"WTF IS \033[30;47m???", a practical cheat-sheet
Font color definitions can be intimidating and nonsense at first,
but it is quite easy, lets just follow character by character:
┌────────┤\033├── Escape character (ESC)
│┌───────┤ [ ├── Define a sequence (many characters in a code)
││
││┌──────┤ X ├── Parameter (optional) ┐
│││┌─────┤ ; ├── Parameter separator │ SGR Code
@holywarez
holywarez / ansible_ror.md
Created February 8, 2020 19:56 — forked from finist/ansible_ror.md
Setup Ruby on Rails application to remote server with Ansible

Установка Ruby on Rails приложения на удаленный сервер с помощью Ansible

Установка Ansible на Ubuntu 16.04

подключаемся к серверу и ставим Ansible

sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
@holywarez
holywarez / gist:0e4928c16f6760c0b9dd779468ffb36e
Created February 8, 2020 15:03 — forked from finist/gist:7433753
Cities of Russia with regions in yaml format
---
- Адыгея:
- Абадзехская
- Адамий
- Адыгейск
- Новая Адыгея
- Нижний Айрюм
- Апостолиди
- Ассоколай
- Кармир-Астх
@holywarez
holywarez / upgrade-postgres-9.3-to-9.5.md
Created April 4, 2016 19:24 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main

This gist is the source code for http://gary.beagledreams.com/page/go-websocket-chat.html

Copyright (c) 2013 Gary Burd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

%html
%style
.breadcrumbs {
background-color: #f5f5f5;
text-align: justify;
line-height: 0;
text-align-last: justify;
padding: 8px 15px;
&:after {
["C000000016939", "C000000016941", "C000000016947", "C000000016944", "C000000016948", "B000000002206", "B000000002208", "B000000002207", "B000000001939", "C000000061426", "C000000061423", "C000000061422", "C000000061420", "C000000061417", "C000000061430", "C000000061416", "C000000061427", "C000000048155", "C000000048161", "C000000048163", "C000000048153", "C000000048151", "C000000048159", "C000000048157", "C000000048144", "C000000048148", "C000000048146", "C000000049203", "C000000049202", "C000000049190", "C000000049204", "C000000049201", "C000000049200", "B000000014014", "C000000049220", "C000000049221", "C000000049219", "C000000042065", "C000000042046", "C000000042059", "C000000042067", "C000000042064", "C000000042063", "C000000042061", "C000000042062", "C000000042060", "C000000042057", "C000000042056", "C000000042053", "C000000042055", "C000000042054", "C000000042051", "C000000042052", "C000000042050", "C000000042048", "C000000042047", "C000000042049", "C000000042045", "C000000042043", "C000000042068", "C0
DELETE
FROM rendered_pages rp
USING rendered_pages orp
WHERE
orp.book_id = rp.book_id
AND orp.number = rp.number
AND orp.created_at < rp.created_at
package controllers
import play.Logger
import play.api._
import play.api.mvc._
import play.api.libs.iteratee._
object Application extends Controller {
val (eventEnumerator, eventChannel) = Concurrent.broadcast[String]
val (chatEnumerator, chatChannel) = Concurrent.broadcast[String]
val chatClient1 = Iteratee.foreach[String](m => println("Client 1: " + m))
val chatClient2 = Iteratee.foreach[String](m => println("Client 2: " + m))
chatEnumerator |>>> chatClient1
chatEnumerator |>>> chatClient2
chatChannel.push(Message("Hello world!"))