Skip to content

Instantly share code, notes, and snippets.

@BlackFoks
BlackFoks / delayed_job_airbrake.rb
Created August 24, 2012 11:04 — forked from granth/delayed_job_airbrake.rb
delayed_job exception notification with airbrake
module Delayed
module Plugins
class Airbrake < Plugin
module Notify
def error(job, error)
::Airbrake.notify_or_ignore(error)
super
end
end
@BlackFoks
BlackFoks / raskell.rb
Created August 15, 2012 10:20 — forked from andkerosine/raskell.rb
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@BlackFoks
BlackFoks / Haml.tmLanguage
Created July 18, 2012 05:22 — forked from unixmonkey/Haml.tmLanguage
Haml Language definition file for TextMate; modified to work with Sublime Text 2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>haml</string>
<string>sass</string>
</array>
<key>foldingStartMarker</key>
@BlackFoks
BlackFoks / gist:2203141
Created March 26, 2012 05:12 — forked from axelav/gist:1839777
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@BlackFoks
BlackFoks / gist:1170243
Created August 25, 2011 08:39
remove all gems
$ gem list --local | cut -d" " -f1 | xargs gem uninstall -aIx
@BlackFoks
BlackFoks / doc_processing.vb
Created July 6, 2011 04:55
Обработчик документации
Sub rep_processing()
is_prev_header = False
Dim pp As Paragraph
Dim regEx
' Add paragraphs
For Each p In ActiveDocument.Paragraphs
If p.Style.NameLocal = "Çàãîëîâîê 1" Or _
p.Style.NameLocal = "Çàãîëîâîê 2" Or _
<%@ Master Language="VB" CodeFile="Default.master.vb" Inherits="Default_master" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Сибирская академия государственной службы</title>
<meta http-equiv="Content-Language" content="ru"/>
@BlackFoks
BlackFoks / gist:791825
Created January 23, 2011 04:41
host-pings-guest2
PS C:\Users\BlackFoks> ping 192.168.1.5
Pinging 192.168.1.5 with 32 bytes of data:
Reply from 192.168.1.5: bytes=32 time<1ms TTL=128
Reply from 192.168.1.5: bytes=32 time<1ms TTL=128
Reply from 192.168.1.5: bytes=32 time<1ms TTL=128
Reply from 192.168.1.5: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.1.5:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
PS C:\Users\BlackFoks> ping 192.168.1.5
Pinging 192.168.1.5 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.1.5:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\Documents and Settings\Admin>ping 192.168.1.3
Обмен пакетами с 192.168.1.3 по 32 байт:
Ответ от 192.168.1.3: число байт=32 время<1мс TTL=128
Ответ от 192.168.1.3: число байт=32 время<1мс TTL=128
Ответ от 192.168.1.3: число байт=32 время<1мс TTL=128
Ответ от 192.168.1.3: число байт=32 время<1мс TTL=128
Статистика Ping для 192.168.1.3: