Skip to content

Instantly share code, notes, and snippets.

View ganchdev's full-sized avatar

George Ganchev ganchdev

View GitHub Profile
import { Controller } from "@hotwired/stimulus";
import Dropzone from "dropzone";
import DirectUploader from "file_uploader/direct_uploader";
import { getAuthenticityToken, getJsonParsed, removeElement } from "utils/dom_helpers";
export default class extends Controller {
static targets = ["input"];
static values = {
blobUrls: Array,
}
@ganchdev
ganchdev / mac_keys.ahk
Last active May 1, 2023 11:29
Autohotkey script file for Mac OS bindings on Win
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Docs:
; https://autohotkey.com/docs/Hotkeys.htm
; https://autohotkey.com/docs/KeyList.htm
; Ref https://autohotkey.com/board/topic/60675-osx-style-command-keys-in-windows/
@ganchdev
ganchdev / gist:125e29ab68ae2e5437a6a560ab39b4ab
Created January 3, 2021 13:11
Realtek RTL8812BU/CU ubuntu driver
This repo: https://github.com/morrownr/88x2bu.
sudo apt-get update
sudo apt-get install -y dkms git
mkdir src
cd ~/src
git clone https://github.com/morrownr/88x2bu.git
cd ~/src/88x2bu
sudo ./install-driver.sh
sudo reboot
@ganchdev
ganchdev / gist:5809484ed7de06cf8e576899681a0e7f
Created July 21, 2020 06:11
Teamspeak full installation linux
1) download the TeamSpeak3-Client-linux_amd64-3.1.6.run from The Teamspeak Website
2) run the TeamSpeak3-Client-linux_amd64-3.1.6.run file with:
chmod 755 TeamSpeak3-Client-linux_amd64-3.1.6.run
./TeamSpeak3-Client-linux_amd64-3.1.6.run
3) move the whole new directory to /opt with
@ganchdev
ganchdev / tailrf.rb
Created June 13, 2020 01:00
Ruby script that "tail -f" a nginx log
#!/usr/bin/env ruby
$stdout.sync = true
$stderr.sync = true
loop do
# Replace -n0 with -n+1 if you want to read from the beginning of file
f = IO.popen(%W[sudo tail -f -n0 /var/log/nginx/access.log])
loop do
select([f])
- empty_count = 0
- @projects.each do |project|
- servers = project.servers.where({ reachable_from_nwh: nil }).or(project.servers.where.not(reachable_from_nwh: true))
- if servers.empty? && project.repository.reachable_from_nwh == true
- empty_count += 1
- next
.o-icon-items__header
%h2.o-icon-items__heading= project.name
@ganchdev
ganchdev / the-boarding-screen.md
Last active October 27, 2019 21:15
Description of the boarding screen

Boarding

One of the most important features of Persi is the data collection flow or the so-called "boarding phase" where users are asked to populate couple of fields about themselves. What we practically want to achieve is an attractive, engaging and easy to grasp UI for series of screens where each screen represents a question/field.

The boarding phase is initiated right after user authentication, hence it's one of the very first things a user will see and interact with. The idea is described in this mockup:

Starting from the left, the first 3 screens with bubbles are not part of the boarding process and could be one screen only, the text will change every 2 seconds, then a sign-up button appears for the users to click. Currently the app only support google sign in and a gmail form is shown, on submissions users are redirected to the first boardin

@ganchdev
ganchdev / gist:7ffb7135e475483cd51e0ef6cf5dbd3a
Created October 8, 2019 14:21
tailwind-dashboard-improved.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Tailwind Starter Template - Day Admin Template: Tailwind Toolbox</title>
<meta name="description" content="description here">
# Note: You must restart bin/webpack-dev-server for changes to take effect
default: &default
source_path: app/javascript
source_entry_path: packs
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: false