Skip to content

Instantly share code, notes, and snippets.

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

Alex soal

🏠
Working from home
View GitHub Profile
@soal
soal / simpleserver.sh
Created November 26, 2012 22:34 — forked from sansumbrella/simpleserver.sh
Python simple server
python -m SimpleHTTPServer 8080
@soal
soal / convert.sh
Created February 15, 2017 08:37 — forked from akost/convert.sh
Bash script for recursive file convertion windows-1251 --> utf-8
#!/bin/bash
# Recursive file convertion windows-1251 --> utf-8
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do
@soal
soal / interceptors.js
Created September 28, 2017 13:58 — forked from javisperez/interceptors.js
Axios interceptor for cache with js-cache
// Usually I use this in my app's config file, in case I need to disable all cache from the app
// Cache is from `js-cache`, something like `import Cache from 'js-cache';`
const cacheable = true,
cache = new Cache();
// On request, return the cached version, if any
axios.interceptors.request.use(request => {
// Only cache GET requests
if (request.method === 'get' && cacheable) {
@soal
soal / test-task.md
Last active December 8, 2017 10:24 — forked from krambertech/test-task.md
Front-End Developer Position: Test Task

Test Task

Основная задача посмотреть насколько хорошо вы сможете разобраться с новыми технологиями в относительно короткий срок. В идеале, на него нужно потратить не более 3 дней. А так - делайте сколько делается, пока мы не закроем вакансию ;)

Описание

Нужно написать одностраничное приложения для просмотра фильмов с помощью The Movie Database API.

При открытии приложения, должен отображаться список популярных фильмов с пагинацией или динамической подгрузкой (на выбор). Также на странице должно быть поле для поиска. Когда ты вводишь туда какой-то текст, должны отобразиться фильмы которые ему соответствуют. Для каждого фильма в списке должен отображаться список жанров (названий жанров, не айдишек), к которым он принадлежит.

При клике на карточку с фильмом, должна быть показана страница с детальной информацией об этом фильме и списком рекоммендованых или похожих (можно и то, и то) фильмов к нему.

#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@soal
soal / keybindings.pl
Created January 24, 2021 16:49 — forked from elgalu/keybindings.pl
Export Ubuntu shortcuts: keybindings.pl -e keys.csv ;; Import (DANGER) Ubuntu shortcuts: keybindings.pl -i keys.csv
#!/usr/bin/perl
use strict;
my $action = '';
my $filename = '-';
for my $arg (@ARGV){
if ($arg eq "-e" or $arg eq "--export"){
$action = 'export';
@soal
soal / widescreen-resize.sh
Created March 3, 2021 15:02 — forked from MortenStabenau/widescreen-resize.sh
Moving windows programmatically in Gnome under Wayland (or X)
#!/bin/bash
# This script programmatically moves around the windows on my screens.
# The JavaScript can be prototyped in Looking Glass (ALT+F2 lg). The documentation of MetaWindow can be found here:
# https://developer.gnome.org/meta/stable/MetaWindow.html
set -e
if [ -z "$1" ]; then
echo "Please give a configuration (1-5)."
exit 1;
fi
@soal
soal / keychron_linux.md
Created February 9, 2022 21:25 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

Configure systemd-resolved to use a specific DNS nameserver for a given domain

Use case

Given

  • I use a VPN to connect to my work network
  • I'm on a Linux computer that uses systemd-resolved
  • I have a work domain called example.com
  • example.com is hosted by both public and private DNS nameservers