This file contains 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
class MarkObsoleteAppointmentsJobConsole | |
BATCH_SIZE = 100 | |
def perform | |
latest_end_at = LastObsolete.first.end_at | |
logger = Logger.new("log/#{Rails.env}-obsolete.log") | |
appointments = Appointment. | |
from("appointments FORCE INDEX (index_appointments_on_end_at)"). | |
includes(:appointment_contexts, :appointment_invitations, :appointment_associations). |
This file contains 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
defmodule IntegrationMonitor.FooBar do | |
def start_link do | |
import Supervisor.Spec | |
children = [supervisor(IntegrationMonitor.Foo, [], restart: :transient)] | |
Supervisor.start_link(children, strategy: :simple_one_for_one, max_restarts: 3, max_seconds: 20, name: __MODULE__) | |
end | |
def start_child do |
This file contains 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
def page(query, from, limit) do | |
from m in query, | |
where: m.id > ^from, | |
limit: ^limit | |
end | |
def to_stream(query, repo, page_size \\ 100) do | |
Stream.resource( | |
fn -> 0 end, |
This file contains 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
def map(collection, fun \\ &(&1)) do | |
map_impl(collection, &spawn/1, &(invoke(fun, &1))) | |
end | |
def map!(collection, fun \\ &(&1)) do | |
map_impl(collection, &spawn_link/1, fun) | |
end | |
defp map_impl(collection, spawn_fun, fun) do | |
me = self |
This file contains 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
rm -r /Library/Frameworks/Mono.framework | |
rm -r /Library/Receipts/MonoFramework-* | |
rm /Users/roman/.config/.mono | |
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do | |
(cd ${dir}; | |
for i in `ls -al | grep /Library/Frameworks/Mono.framework/ | awk '{print $9}'`; do | |
rm ${i} | |
done); | |
done |
This file contains 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
foreach(var user in users) | |
{ | |
Console.WriteLine(user.Name); | |
} | |
users.ToObservable() | |
.Subscribe(x => Console.WriteLine(x.Name)) | |
public interface IEnumerable<T> | |
{ |
This file contains 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 | |
tasklist /FI "IMAGENAME eq hipchat.exe" 2>NUL | find /I /N "hipchat.exe">NUL | |
if "%ERRORLEVEL%"=="0" taskkill /f /im "hipchat.exe" | |
start /b /d "%ProgramFiles(x86)%\Atlassian\HipChat" hipchat.exe | |
exit |
This file contains 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
wget http://download.redis.io/redis-stable.tar.gz | |
tar xvzf redis-stable.tar.gz | |
cd redis-stable | |
make |
This file contains 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
public static void Invoke(Func<int> func) | |
{ | |
int result = 0; | |
try | |
{ | |
result = func(); | |
} | |
catch (Exception) | |
{ | |
//oblsuga bledow |
This file contains 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
Set-WindowsExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Enable-RemoteDesktop | |
cinst GoogleChrome | |
cinst VisualStudio2013Ultimate | |
cinst resharper | |
cinst notepadplusplus | |
cinst fiddler4 | |
cinst dotpeek | |
cinst virtualbox |
NewerOlder