Skip to content

Instantly share code, notes, and snippets.

View manavortex's full-sized avatar

manavortex manavortex

View GitHub Profile
@manavortex
manavortex / rspec_rails_cheetsheet.rb
Last active November 10, 2016 16:42 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
context "GET index" do
#context "POST create" do
#context "GET show" do
#context "PATCH update" do (or PUT update)
#context "DELETE destroy" do
#context "GET new" do
@manavortex
manavortex / button_with_textures
Created December 22, 2016 21:42
Button with textures
<Button name="DailyAutoShare_ButtonShare" verticalAlignment="CENTER">
<Dimensions x="35" y="35" />
<!-- Change buttons placement here -->
<Anchor point="TOPLEFT" relativeTo="DasList_Backdrop" relativePoint="TOPLEFT" offsetX="115" offsetY="20" />
<Textures
normal="DailyAutoShare/textures/share_up.dds"
pressed="DailyAutoShare/textures/share_down.dds"
mouseOver="DailyAutoShare/textures/share_down.dds"
/>
/*
* Copyright (C) 2004-2009 See the AUTHORS file for details.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*
* Made by Mini
*/
@manavortex
manavortex / package.bat
Last active June 11, 2019 11:32 — forked from haggen/package.bat
Package your ESO add-on ready for distribution.
:: Package your ESO add-on ready for distribution.
:: Version 1.3 Sat, 14 Nov 2015 22:36:23 +0000
@echo off
setlocal enableextensions enabledelayedexpansion
REM set to location where you want this zipped. Leave it empty if you want to zip to current dir.
set EXPORTPATH=%USERPROFILE%\Dropbox
REM delete zips of previous versions? Delete or clear if not
set DELETEOLDZIPS=true
@manavortex
manavortex / Accessible_Info_Viewer.ahk
Created July 2, 2019 09:54
a resizable version of Accessible Info Viewer
; Accessible Info Viewer
; http://www.autohotkey.com/board/topic/77888-accessible-info-viewer-alpha-release-2012-09-20/
; https://dl.dropbox.com/u/47573473/Accessible%20Info%20Viewer/AccViewer%20Source.ahk
#SingleInstance force
_colTextW := 55
_col2W := 120
_col4W := 51
@manavortex
manavortex / Accessible_Info_Viewer.ahk
Created July 2, 2019 09:54
a resizable version of Accessible Info Viewer
; Accessible Info Viewer
; http://www.autohotkey.com/board/topic/77888-accessible-info-viewer-alpha-release-2012-09-20/
; https://dl.dropbox.com/u/47573473/Accessible%20Info%20Viewer/AccViewer%20Source.ahk
#SingleInstance force
_colTextW := 55
_col2W := 120
_col4W := 51
@manavortex
manavortex / restart_wacom_driver.sh
Created October 3, 2019 17:32
Makes older wacom tables less unusable on osX mojave
#!/bin/sh
tail -F /var/log/system.log | while read line; do
if echo "$line" | grep -q '.*wacom.*'; then
kill $(pidof PenTabletDriver)
sleep 1
open /Library/Application\ Support/Tablet/PenTabletDriver.app
fi
done
@manavortex
manavortex / showToast.js
Last active February 25, 2021 09:48
showToast.js
// https://codepen.io/uffou/pen/JNVWVy
function showToast(_title='', _text=''){
window.toast.create({
title: _title,
text: _text
});
}
window.showToast = showToast;
(function(root, factory) {
@manavortex
manavortex / waitForElement.js
Last active March 13, 2021 10:58
async function waitForElement
let timeout = 75;
const maxTimeout = 5000;
/**
* Async function: call with checkElement('#myElement').then((el) { ... }) .
* Or see first block in waitForAndPrepend as per nightpool's suggestion in MR 2037
*
* @param {string} selector - document query selector.
* @param {string} returnAry - run querySelectorAll rather than querySelector?
*/