Skip to content

Instantly share code, notes, and snippets.

View andreimoment's full-sized avatar

Andrei Andreev andreimoment

View GitHub Profile
@andreimoment
andreimoment / hello.vue
Created June 23, 2020 21:42 — forked from ryenski/hello.vue
Stimulus.js + Vue.js
<template>
<div id="app">
<p>{{ message }}</p>
</div>
</template>
<script>
export default {
data: function () {
return {
@andreimoment
andreimoment / parse-IIS-Log.cmd
Created January 8, 2019 20:30 — forked from GuyHarwood/parse-IIS-Log.cmd
parse raw IIS logs using MS Log Parser into csv file
logparser -i:W3C -o:csv "SELECT * INTO c:\temp\results.csv FROM c:\temp\myLogFile.log"
@andreimoment
andreimoment / gist:59710a5b11b44c640a60083007cdd7fb
Created September 28, 2018 23:22 — forked from Aupajo/gist:4654510
List of TZInfo timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@andreimoment
andreimoment / customize_error.rb
Last active July 18, 2020 13:54 — forked from telwell/customize_error.rb
Customize Field Errors with Rails 5 and Bootstrap
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = ''
form_fields = %w(textarea input select)
tag_elements = Nokogiri::HTML::DocumentFragment.parse(html_tag).css "label, " + form_fields.join(', ')
tag_elements.each do |e|
if e.node_name.eql? 'label'
html = %(#{e}).html_safe
elsif form_fields.include? e.node_name

Custom Twitter Stylesheet

Craig Mod does a bigger overhaul with Twitter for Minimalists, but this will only do the following:

  • Hides promoted tweets and trends
  • Hides the useless “Expand” link that appears under every tweet
  • Tones down the blue conversation line to a barely-visible gray
  • Hides all numbers

You can add this CSS in Safari with this extension. The URL to target is twitter.com/*.

<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea>
...
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea>
...
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script>
// Hook up ACE editor to all textareas with data-editor attribute
$(function () {
@andreimoment
andreimoment / .gitconfig
Last active December 26, 2015 04:39 — forked from orj/.gitconfig
gitconfig settings for p4merge
[merge]
keepBackup = false
tool = custom
[mergetool "custom"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
class RomanNumeral
def self.add_roman(roman_number)
result = 0
roman_number.each_char do |c|
result += roman_lookup(c)
end
@andreimoment
andreimoment / classes.sass
Created November 5, 2012 23:23 — forked from OutThisLife/classes.sass
classes.sass
/**
* Sass mixins
*/
@charset "UTF-8"
// Force output of above line by adding a unicode character. ♫
// -----------------------------------------------
@mixin textFillColor($type)
@andreimoment
andreimoment / webdev-tools.md
Created October 15, 2012 17:03 — forked from poteto/webdev-tools.md
Web tools directory