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
#!/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
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
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
/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
#!/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
@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
#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
module Populator | |
class Record | |
# See http://stackoverflow.com/questions/4470108/when-monkey-patching-a-method-can-you-call-the-overridden-method-from-the-new-i | |
old_initialize = instance_method(:initialize) | |
define_method(:initialize) do |class_name, id| | |
old_initialize.bind(self).(class_name, id) | |
@class_name = class_name | |
end | |
def from_factory |
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
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024k | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
echo "/swapfile none swap sw 0 0 " | sudo tee -a /etc/fstab | |
echo 0 | sudo tee /proc/sys/vm/swappiness | |
echo vm.swappiness = 0 | sudo tee -a /etc/sysctl.conf | |
sudo chown root:root /swapfile | |
sudo chmod 0600 /swapfile | |
swapon -s |