Skip to content

Instantly share code, notes, and snippets.

View leonid-shevtsov's full-sized avatar
🇺🇦
Help Ukraine Win

Leonid Shevtsov leonid-shevtsov

🇺🇦
Help Ukraine Win
View GitHub Profile
//Ctrl+C, Ctrl+V в адресную строку http://leprosorium.ru/xxxxxx/comments
javascript:els=$$('#js-commentsHolder div.dt img');$(document.body).empty();els.each(function(el) { el.set('styles',{display:'block'});el.inject($(document.body)); });
function quote_sel(username)
{
element = document.getElementById('post_text');
if (window.getSelection) {
var str = window.getSelection();
} else if (document.selection && document.selection.createRange) {
var range = document.selection.createRange();
var str = range.text;
} else {
alert("К сожалению, Ваш браузер не поддерживает эту функцию");
#!/usr/bin/env ruby
# Lighthouse + Git
# post-receive hook
LIGHTHOUSE_TOKEN = 'owner token here (the default one)'
LIGHTHOUSE_ACCOUNT = 'account (the subdomain)'
LIGHTHOUSE_PROJECT = 'project id (look in /projects/[id])'
# Store individual user tokens here.
# They are required so that changesets are mapped to the correct Lighthouse username
<% environments_to_check = ['staging', 'production' ] %>
<script type="text/javascript">
var Hoptoad = {
host : <%= host.to_json %>,
api_key : <%= api_key.to_json %>,
notice : <%= notice.to_json %>,
checkEnvironment : function(environment) {
# put this into yer initializers
#
# class Ad < ActiveRecord::Base
# belongs_to :city
# belongs_to :color
# cache_title :city, :color
# end
#
# then Ad.first.city_title
[Main]
Env = 1.4.9.1 - 2.0.50727.4927.Microsoft Windows NT 6.1.7600.0
Target = Windows XP Home Edition SP3 - 5.1.2600.5512 - English (United States)
[Tasks]
Remove Components
Tweaks
Create a Bootable ISO
Options
#!/usr/bin/env ruby
require 'etc'
windows_keyfile_dir = "D:\\users\\leonid\\keys\\"
keyfile_dir = File.expand_path('~/putty_keys')
puttygen = `which puttygen`.strip
default_ssh_port = 22
default_user = Etc.getpwuid.name
require 'ipaddr'
# This is a class that tracks visits on a site internally.
# One of the major demands was determining where the visitor came from.
class Visitor < ActiveRecord::Base
validates_presence_of :entry_uri
validates_presence_of :exit_uri
validates_presence_of :ip
def self.recognizes_source(source_name, options = nil)
#!/usr/bin/env ruby
require 'rubygems'
require 'active_support/core_ext'
pattern = ARGV[0]
if File.directory?(pattern)
pattern += "/*"
end
alias_method :old_data=, :data=
def data=(value)
old_data=(value)
self.file_updated=true
end