Skip to content

Instantly share code, notes, and snippets.

View wellic's full-sized avatar

Valerii Savchenko wellic

View GitHub Profile
@kobylyanets
kobylyanets / telegram-installer.sh
Last active October 29, 2018 01:01
telegram-installer.sh
#!/bin/bash
echo "============================================="
echo "== Telegram Script Installer =="
echo "== =="
echo "== for www.LinuxRussia.com =="
echo "============================================="
echo "Downloading necesary files..."
cd /tmp
@prestontighe
prestontighe / Dockerfile
Last active July 11, 2017 18:16
XDebug Docker Issue. The Dockerfile is used in the `toozick/smu-arcade-machine-management-console-php-apache:v1` image. Everything with our setup works except XDebug. What could the problem be?
# FROM debian:jessie
FROM php:5.6-apache
MAINTAINER Preston Tighe
## Install
RUN apt-get update
# Apache server name
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
@nepsilon
nepsilon / 3-hidden-css-tips.md
Last active May 13, 2021 15:07
3 hidden CSS tips — First published in fullweb.io issue #62

3 hidden CSS tips

1. Use empty-cells to style table empty cells:

Surprisingly the browser support is quite good and extends back to IE8. Convenient to give less visual predominance to empty cells.

table {
  empty-cells: hide;
}
@kgriffs
kgriffs / uuid_regex.py
Last active September 28, 2023 19:03
UUID regular expressions (regex) with usage examples in Python
import re
# RFC 4122 states that the characters should be output as lowercase, but
# that input is case-insensitive. When validating input strings,
# include re.I or re.IGNORECASE per below:
def _create_pattern(version):
return re.compile(
(
'[a-f0-9]{8}-' +
@robertpainsi
robertpainsi / README.md
Last active January 31, 2025 14:55
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
@alecthegeek
alecthegeek / gitcomenu.sh
Last active July 14, 2017 13:05
Make `git checkout <branch>` into a menu selection
OPS3=$PS3
echo There are multiple branchs in this repo. Please select the one you want to use
PS3='If you're not sure just choose "master" '
select br in $(git branch|sed -e '/^[* ] /s///'); do
[[ -n $br ]] && git checkout $br &&
break
done
PS3=$OPS3
@Faheetah
Faheetah / Dockerfile
Last active October 19, 2022 15:22
Docker patterns/anti-patterns
### Generic Dockerfile demonstrating good practices
### Imports
# Bad-ish, we do not need Ubuntu for this, nor do we want latest if we are using in a build system, predictable is better
FROM ubuntu:latest
# Better, using a small image since our app has no dependency on Ubuntu
FROM alpine:3.3
@snorfalorpagus
snorfalorpagus / sqlalchemy_nested_example.py
Created April 6, 2016 16:44
SQLAlchemy nested transactions
"""
This script demonstrates the use of nested transactions in SQLAlchemy, including
a workaround for an issue with the SQLite backend.
References:
http://docs.sqlalchemy.org/en/latest/orm/session_transaction.html#using-savepoint
http://docs.sqlalchemy.org/en/latest/dialects/sqlite.html#serializable-isolation-savepoints-transactional-ddl
"""
from sqlalchemy import Column, String, Integer
@olih
olih / jq-cheetsheet.md
Last active April 9, 2025 07:56
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@smelukov
smelukov / mvvm.html
Last active May 27, 2023 10:58
Very simple MVVM (dynamic data binding) on JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>MVVM</h1>