Skip to content

Instantly share code, notes, and snippets.

View theycallmeS's full-sized avatar
🦭

Alexey Efremov theycallmeS

🦭
View GitHub Profile
@theycallmeS
theycallmeS / slowpoking_rust.md
Last active February 9, 2019 11:04
Slowpoking Rust

Personal notes on Rust language and its features

Things to learn:

@theycallmeS
theycallmeS / web_parse_w_bash.sh
Created January 22, 2015 11:58
Parse website for a string of text in HTML sources
# Simple wget grab-and-parse snippet
# By courtesy of Mikhail Zhuravlev ([email protected])
# Grab all .html and .htm files up to level 4
wget -nc --random-wait -r --level 4 --accept .html .htm http://URL
# Search for matching pattern, write to text file
grep -Hir --include=*.{html,htm} 'pattern' . > filename.txt
@theycallmeS
theycallmeS / wordpress-permalinks.nginx.conf
Created January 18, 2015 13:14
Enabling rewrite rules for Wordpress permalinks
@theycallmeS
theycallmeS / !vsftpd_wizardry.md
Last active August 29, 2015 14:13
Debian 7 vsftpd configuration for webserver directories
@theycallmeS
theycallmeS / class_eval.md
Last active August 29, 2015 14:12
Proper class_eval in Ruby

Use here_document with class_eval to simplify debugging:

class_eval <<-"end_eval", __FILE__, __LINE__

  def #{block_accessor}(*args, &block)
    unless args.empty? && block.nil?
      args.push block if block_given?
      @#{block_accessor} = [args].flatten
 end
@theycallmeS
theycallmeS / .bash_profile
Last active January 4, 2016 05:49
Personal Bash prompt
##
# enable git prompt extension
source ~/.git-prompt.sh
##
# Set prompt colors
LIGHT_GRAY="\[\033[1;30m\]"
LIGHT_YELLOW="\[\033[0;33m\]"
LIGHT_GREEN="\[\033[0;32m\]"
NO_COLOUR="\[\033[0m\]"
@theycallmeS
theycallmeS / chrome_frame.html
Created December 16, 2013 19:04
Using Chrome Frame through embedded ActiveX
<HTML>
<HEAD>
<TITLE> Chrome Frame Test </TITLE>
</HEAD>
<BODY>
<object id="ChromeFrame" width="100%" height="100%"
codebase="http://www.google.com"
classid="CLSID:E0A900DF-9611-4446-86BD-4B1D47E7DB2A">
<param name="src" value="<% request.getContextPath(); %>">
<embed id="ChromeFramePlugin" name="ChromeFrame"
load 'deploy/assets'
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
%x{bundle exec rake assets:precompile}
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
%x{bundle exec rake assets:clean}
end
@theycallmeS
theycallmeS / .powrc
Created November 23, 2013 00:13
Example basic configuration for Pow and RVM
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ]; then
source "$rvm_path/scripts/rvm"
source ".rvmrc"
fi
@theycallmeS
theycallmeS / passenger_and_rvm.md
Last active December 27, 2015 17:29
Configuring Passenger and RVM

Phusion Passenger configuration with RVM support

Date: 7 Nov 2013
Weather: shitty

Symptoms:

After running Passenger, on the first request:

Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)