This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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)); }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("К сожалению, Ваш браузер не поддерживает эту функцию"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% 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) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'active_support/core_ext' | |
pattern = ARGV[0] | |
if File.directory?(pattern) | |
pattern += "/*" | |
end |
OlderNewer