Skip to content

Instantly share code, notes, and snippets.

View skatkov's full-sized avatar
🏠
Working from home

Stanislav (Stas) Katkov skatkov

🏠
Working from home
View GitHub Profile
@skatkov
skatkov / mass_text_change.rb
Created June 22, 2012 11:47
change loads of text files in directory
#!/usr/bin/env ruby
folder = "Products_HTML/"
new_folder = "fixed_HTML/"
fileForChange = []
def changeFile(file_list, f, n)
Dir.mkdir(n)
file_list.each do |file_name|
text = File.read(f + file_name)
File.open(n + file_name, "w") {|file| file.puts text.gsub(/<a href=/, "<a style='color:blue' href=")}
@skatkov
skatkov / youtube.rb
Created July 11, 2012 02:28 — forked from jamieowen/youtube.rb
Octopress Youtube plugin...
module Jekyll
class Youtube < Liquid::Tag
@width = 640
@height = 390
def initialize(name, id, tokens)
super
@id = id
end
@skatkov
skatkov / bahtsold.rb
Created August 14, 2012 00:49
Parsing ads from bahtsold.com
#coding: utf-8
require 'wombat'
class BahtsoldCrawler
include Wombat::Crawler
base_url "http://www.bahtsold.com"
path "/en/results?category=7&ad_type=NULL&ar1=1006&c1=377&c2=NULL&6=NULL&price=2&co=Thailand-1"
document_format :html
@skatkov
skatkov / heroku_deploy.rake
Created October 17, 2012 21:31 — forked from michaeldwan/heroku_deploy.rake
Simple Rake task for customizing deployment to Heroku
# List of environments and their heroku git remotes
ENVIRONMENTS = {
:staging => 'myapp-staging',
:production => 'myapp-production'
}
namespace :deploy do
ENVIRONMENTS.keys.each do |env|
desc "Deploy to #{env}"
task env do
@skatkov
skatkov / untitled_.idea_ant.xml
Created February 5, 2013 17:25
Http parsing example for Ivan
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<defaultAnt bundledAnt="true" />
</component>
</project>
<?xml version="1.0" encoding="utf-8"?>
<opml version="1.0">
<head>
<title>My feedly feeds</title>
</head>
<body>
<outline text="android">
<outline text="Android-er" htmlUrl="http://android-er.blogspot.com/" type="rss" xmlUrl="http://feeds.feedburner.com/Android-er?format=xml"/>
</outline>
@skatkov
skatkov / SmsService.java
Created July 22, 2013 15:26
SmsService...
package ee.era.geek.sms_spammer.service;
import android.app.Service;
import android.content.Intent;
import android.os.*;
import android.telephony.SmsManager;
import android.text.format.DateFormat;
import android.util.Log;
import ee.era.geek.sms_spammer.ConfigUtil;
@skatkov
skatkov / .zhenv
Created February 22, 2014 16:10
issue with prezto update
#
# Defines environment variables.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Ensure that a non-login, non-interactive shell has a defined environment.
if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
source "${ZDOTDIR:-$HOME}/.zprofile"
fi§
class MiniTest::Spec
def self.shared_examples
@shared_examples ||= {}
end
end
module MiniTest::Spec::SharedExamples
def shared_examples_for(desc, &block)
MiniTest::Spec.shared_examples[desc] = block
end
Chain INPUT (policy DROP)
target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere
Chain FORWARD (policy DROP)