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
| contextTypes: | |
| router: React.PropTypes.func | |
| tree: React.PropTypes.func | |
| componentDidMount: -> | |
| # TODO: set initial currentPath on page load | |
| CurrentPathCursor = @props.tree.select('currentPath') | |
| CurrentPathCursor.on 'update', (e) => |
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
| namespace :webpack do | |
| desc 'create symlinks for images and fonts' | |
| task symlink: :environment do | |
| images_target = Rails.root.join('app', 'assets', 'images/') | |
| fonts_target = Rails.root.join('app', 'assets', 'fonts/') | |
| images_link = Rails.root.join('client', 'assets', 'images/') | |
| fonts_link = Rails.root.join('client', 'assets', 'fonts/') | |
| FileUtils.mkdir_p(images_link) | |
| FileUtils.mkdir_p(fonts_link) |
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
| # Check Ubuntu version | |
| lsb_release -a | |
| # Check version of the kernel | |
| uname -r | |
| # MongoDB version | |
| mongod --version | |
| # PostgreSQL version |
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
| find . -name "*.haml" | xargs sed -i 's/[ \t]*$//' |
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
| #!/bin/sh | |
| # Using /bin/sh which is guaranteed to be present on any posix system. | |
| # If you want to add shell specific parts in the script than replace this. | |
| # E.g. if you want to use bash specific stuff then change it to: | |
| # #!/usr/bin/env bash | |
| # Make sure that the shebang is on the first line of the script (no comments above it!) | |
| # While true, pause 5 seconds, then append information to Mylogfile | |
| # | |
| # Usage: ./ram-monitor.sh >> logfile & |
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
| Sidekiq.logger.formatter = proc do |severity, time, context, message| | |
| colorized_time = "#{time.utc.iso8601}".colorize(:cyan) | |
| case severity | |
| when 'INFO' | |
| colorized_severity = "#{severity}:".colorize(:green) | |
| "#{colorized_time} #{Process.pid} TID-#{Thread.current.object_id.to_s(36)}#{context} #{colorized_severity} #{message}\n" | |
| when 'ERROR' | |
| colorized_severity = "#{severity}:".colorize(:red) | |
| "#{colorized_time} #{Process.pid} TID-#{Thread.current.object_id.to_s(36)}#{context} #{colorized_severity} #{message}\n" |
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
| {acl, admin, {user, "adminname", "yyyy.ru"}}. | |
| {hosts, ["yyyy.ru"]}. | |
| {loglevel, 4}. | |
| {listen, | |
| [ | |
| {5222, ejabberd_c2s, [ | |
| {access, c2s}, | |
| {shaper, c2s_shaper}, | |
| {max_stanza_size, 65536}, |
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
| function globalpath(){ | |
| old=$IFS | |
| IFS=: | |
| printf "%s\n" $PATH | |
| IFS=$old | |
| } |
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
| class InterestingBehaviour | |
| def perform | |
| if var1.blank? | |
| var1 = 56 | |
| end | |
| pp var1 # prints nil | |
| end |
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
| SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'TARGET_DB' AND pid <> pg_backend_pid(); |