Skip to content

Instantly share code, notes, and snippets.

View aTei's full-sized avatar

Maksymenkov Eugene aTei

View GitHub Profile
@aTei
aTei / LastTarget.lua
Created August 25, 2024 16:19
WoW addon that makes it easier to find alive target with the same name. `/lasttarget` in chat
local lastTargetName = nil
-- Create a frame to capture events
local frame = CreateFrame("Frame")
-- Register the frame to listen to the ADDON_LOADED event and PLAYER_TARGET_CHANGED event
frame:RegisterEvent("ADDON_LOADED")
frame:RegisterEvent("PLAYER_TARGET_CHANGED")
-- Function to handle events
@aTei
aTei / before_after.md
Last active August 26, 2025 12:43
markdown: before/after
before
after
@aTei
aTei / ror_partial.regex
Last active January 29, 2020 17:15
Ruby on Rails (RoR) RegEx to search all partial usages
render.+?('|")(front/.+)?_view_name_('|")
/ Example: render.+?('|")(front/.+)?place_info('|")
@aTei
aTei / _google_analytics.html.erb
Created March 15, 2017 07:54
Devise 4: track Sign Ups inside views (for example, in Google Analytics)
<script>
...
init google analytics
...
<% if defined?(notice) && (notice == t('devise.registrations.signed_up')) %>
// send GA event or pageview about Sucessful sign up here, example
ga('send', 'pageview', '/users/sign_up/success');
<% end %>
</script>
@aTei
aTei / _favicons.slim
Last active April 19, 2016 09:51
Crossbrowser favicons for Ruby on Rails 3+ (slim template engine)
/ `= render 'favicons'` inside <head> in your `layouts/application.html` (and all other layouts)
link rel="apple-touch-icon" sizes="192x192" href=image_url("favicons/favicon-192x192.png")
link rel="icon" type="image/png" sizes="192x192" href=image_url("favicons/favicon-192x192.png")
/ https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/pinnedTabs/pinnedTabs.html
link rel="mask-icon" href=image_url("favicons/safari-pinned-tab.svg") color="#5bbad5"
meta name="theme-color" content="#5bbad5"
/ browserconfig.xml https://gist.github.com/aTei/d322dc095f7fc6b0ce857c82d2d1e901
@aTei
aTei / manifest.webmanifest
Created March 30, 2016 09:27
Manifest part for crossbrowser favicons for Ruby on Rails 3+
{
"name": "YourDomain.com",
"short_name": "YourDomain"
}
@aTei
aTei / browserconfig.xml
Last active March 30, 2016 09:25
Windows part for crossbrowser favicons for Ruby on Rails 3+
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="<%= asset_path("favicons/mstile-70x70.png") %>"/>
<square150x150logo src="<%= asset_path("favicons/mstile-150x150.png") %>"/>
<square310x310logo src="<%= asset_path("favicons/mstile-310x310.png") %>"/>
<wide310x150logo src="<%= asset_path("favicons/mstile-310x150.png") %>"/>
<TileColor>#ff6e3f</TileColor>
</tile>
@aTei
aTei / gulpfile.js
Created March 4, 2016 11:54
Ruby on Rails LiveReload only CSS (not a whole page) on SCSS change
// Ruby on Rails LiveReload only CSS (not a whole page) on SCSS change
// 1. Install LiveReload Chrome extention https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en
// 2. Run `rails server` and `gulp watch`
// 3. Click `Enable Livereload` button in Chrome
// 4. Edit you SCSS
// 5. Success!
var gulp = require('gulp');
var livereload = require('gulp-livereload');
@aTei
aTei / rails-scss-lint
Last active December 28, 2015 13:46
Run scss-lint with JSON output
#!/usr/bin/env ruby
exec "scss-lint",
"app/",
"--config", "shared/az-misc/config/scss-lint.yml",
"--format", "JSON",
"--out", "scss-lint-log.json"
@aTei
aTei / Memo.coffee
Created December 25, 2015 11:41
Fixer: fixing elements to screen or other elements (depends on jQuery)
class Memo
classCache: {}
cssCache: {}
addClass: (element, name)->
@toggleClass(element, name, true)
removeClass: (element, name)->
@toggleClass(element, name, false)