Skip to content

Instantly share code, notes, and snippets.

View vadviktor's full-sized avatar
🍀
Mining Ruby 💎 ⛏️

Viktor (Icon) VAD 🍀 vadviktor

🍀
Mining Ruby 💎 ⛏️
View GitHub Profile
@Zackptg5
Zackptg5 / Manjaro_HyperV_Setup.md
Last active October 22, 2023 11:50
Manjaro HyperV Install Guide

Deprecated - Microsoft quit updating vm tools in favor of WSL2, it's only a matter of time before this breaks untirely (if it isn't already).

Credits, the original guide which has strangely vanished but can still be found via wayback machine here

This is largely the same as the original but with some updates

  • Setup a new machine in HyperV Manager. Make sure you choose 'Generation 2' and assign default switch for networking (or whatever other adapter you use). Then go to the new VM's settings, disable secure boot, and attach the manjaro iso to it (at the time of writing this, gnome doesn't work).
  • Boot up the vm, you'll be meeting with a black screen or the cli will show it stopped around display starting or whatever. Drop into terminal with CTL + ALT+ F2.
  • Login and type: pacman -Sy && pacman -S xf86-video-fbdev
  • Then restart the display manager: `systemctl r
@castwide
castwide / rails.rb
Last active April 27, 2024 08:54
Enhance Rails Intellisense in Solargraph
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# You can put this file anywhere in the project, as long as it gets included in
# the workspace maps. It's recommended that you keep it in a standalone file
# instead of pasting it into an existing one.
#
# @!parse
# class ActionController::Base
@nanmu42
nanmu42 / openinbrowser.go
Created May 20, 2019 09:43
Golang: Open URL in Browser
func openBrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@maartenba
maartenba / inspectcode.xslt
Last active May 8, 2024 13:15
R# InspectCode XSLT
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:key name="ISSUETYPES" match="/Report/Issues/Project/Issue" use="@TypeId"/>
<xsl:output method="html" indent="yes"/>
<xsl:template match="/" name="TopLevelReport">
<html>
<head>
<title>Resharper InspectCode Report</title>
@vadviktor
vadviktor / keybindings.json
Last active July 24, 2021 22:30
my visual studio code settings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
@gieart87
gieart87 / gist:69c781700267fa314bfcb4259d6e5869
Created August 9, 2016 02:47
Rails : Override Mime Type and Respond Default Format in Controller
# force as xml when params[:format] isn't present
request.format = 'xml'.to_sym if params[:format].nil?
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@vadviktor
vadviktor / wget.sh
Last active August 26, 2022 19:09
Download rails guide and api doc for specific versions
wget --recursive --convert-links --page-requisites --relative --reject '*.mobi' "https://guides.rubyonrails.org/v4.2.4/"
wget --recursive --convert-links --page-requisites --relative "https://api.rubyonrails.org/v4.2.4/"
wget --recursive --convert-links --page-requisites --level=0 --no-parent "https://relishapp.com/rspec/rspec-core/v/3-9/"
wget --recursive --convert-links --page-requisites --level=0 --no-parent "https://relishapp.com/rspec/rspec-expectations/v/3-9/docs"
wget --recursive --convert-links --page-requisites --level=0 --no-parent "https://relishapp.com/rspec/rspec-rails/v/3-9/docs"
wget --recursive --convert-links --page-requisites --level=0 --no-parent "https://relishapp.com/rspec/rspec-mocks/v/3-9/docs"
@iamralch
iamralch / compress.go
Last active April 16, 2023 03:04
ZIP archives in Golang
import (
"archive/zip"
"io"
"os"
"path/filepath"
"strings"
)
func zipit(source, target string) error {
zipfile, err := os.Create(target)
@harlow
harlow / golang_job_queue.md
Last active July 12, 2024 03:19
Job queues in Golang