This file contains hidden or 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
#rand(3..150).times do | |
# tender.items << Item.first(offset: rand(Item.count)) | |
#end | |
# See http://hashrocket.com/blog/posts/rails-quick-tips-random-records | |
#tender.items = Item.where(Item.pluck(:id).shuffle[0..rand(3..150)]) | |
# For Postgres | |
tender.items = Item.limit(rand(3..150)).order('RANDOM()') | |
# For MySQL |
This file contains hidden or 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
@echo off | |
rem Every second, check to see if volume is mounted | |
echo Waiting for volume… | |
:keepwaiting | |
ping -n 1 -w 1000 127.0.0.1 > nul | |
if not exist S:\ goto keepwaiting | |
start "Dropbox" "C:\Users\UserName\AppData\Roaming\Dropbox\bin\Dropbox.exe" | |
start "Google Drive" "" |
This file contains hidden or 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 | |
# encoding: utf-8 | |
`chcp 65001` | |
require 'rubygems' | |
require 'httpclient' | |
require 'csv' | |
filename = ARGV[0] || 'data/in.csv' |
This file contains hidden or 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
/robots* | |
!/robots.php |
This file contains hidden or 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
upload/* | |
bitrix/* | |
!bitrix/templates/ | |
!bitrix/php_interface/ | |
bitrix/php_interface/dbconn.php | |
bitrix/components/bitrix/* | |
!bitrix/components/ | |
!bitrix/modules/ | |
bitrix/modules/* |
This file contains hidden or 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 'colorize' | |
require 'win32console' | |
puts 'A red line'.red | |
puts 'A green line'.green |
This file contains hidden or 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 "csv" | |
require "FileUtils" | |
require 'open-uri' | |
filename = ARGV[0] | |
skip_line = true | |
CSV.foreach(filename, { :col_sep => "\t" }) do |row| |
This file contains hidden or 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
#nav ul li { | |
@for $i from 1 through 20 { | |
&:nth-child(#{$i}) { | |
z-index: 1000 - $i | |
}; | |
} | |
} |
This file contains hidden or 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
<? | |
if (CModule::IncludeModule("iblock")) { | |
$res = CIBlockElement::GetList(array(), array('IBLOCK_ID'=>23, 'ACTIVE'=>'Y'), false, false, array('NAME', 'ID', 'IBLOCK_ID', 'PROPERTY_FLAT_NUMBER')); | |
//$arElement = $res->Fetch(); | |
//echo '<pre>'; var_dump($arElement); echo '</pre>'; | |
while($arElement = $res->GetNext()) { | |
preg_match('(\d+)', ($arElement['NAME']), $matches); | |
$flatNumber = null; | |
if(count($matches) > 0) { | |
$flatNumber = intval($matches[0]); |
This file contains hidden or 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
#!/bin/bash | |
_file=$(mktemp -t "check_robots_internal_XXXXXX") | |
find /www/ -maxdepth 2 -name robots.txt | xargs grep "^[^#]*Disallow: /\s*$" -L > $_file | |
# First, try to copy the default robots.txt to all the dirs missing it | |
find /www/ -mindepth 1 -maxdepth 1 -type d '!' -exec test -e "{}/robots.txt" ';' -print0 | xargs -0 -I target_folder cp /www/0default/robots.txt target_fo | |
# If it somehow failed for some of the folders, then report | |
find /www/ -mindepth 1 -maxdepth 1 -type d '!' -exec test -e "{}/robots.txt" ';' -print >> $_file | |
if [ -s "$_file" ] |