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
<?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>compose</key> | |
<dict> | |
<key>characterCounterFont</key> | |
<string>11 LucidaGrande-Bold</string> | |
<key>font</key> | |
<string>13 LucidaGrande</string> |
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
response: { | |
user: { | |
uid: 1, | |
first_name: 'Павел', | |
last_name: 'Дуров', | |
nickname: '', | |
screen_name: 'durov', | |
sex: 2, | |
bdate: '10.10.1984', | |
city: '2', |
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
#!/usr/bin/env ruby | |
last_commit = `git rev-parse HEAD`.chomp | |
system 'git pull --rebase' | |
news = `git whatchanged #{last_commit}..HEAD` | |
files = Hash.new do |hash, key| | |
hash[key] = { :status => [], :author => [] } | |
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
require 'bundler/capistrano' | |
logger.level = Logger::DEBUG # Logger::IMPORTANT | |
default_run_options[:pty] = true | |
ssh_options[:forward_agent] = true | |
server 'example.com', :web, :app, :db, :sidekiq, primary: true | |
set :application, 'example' |
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
cd ~/Library/LaunchAgents | |
wget https://gist.githubusercontent.com/localhots/c224b49f4f70b937e2d1/raw/2b60ee2593310fa89aea4396dc7e5c2ada37b608/ru.aviasales.notorrents.plist | |
launchctl load xxx.localhots.notorrents.plist | |
cd - |
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
[ | |
{ | |
"weight": "400", | |
"style": "italic", | |
"family": "ABeeZee" | |
}, | |
{ | |
"weight": "400", | |
"style": "normal", | |
"family": "ABeeZee" |
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
%w[ logger yaml rack eventmachine ].each(&method(:require)) | |
log = Logger.new(STDOUT) | |
config = YAML.load_file('config.yml') | |
Thread.new{ EM.run } | |
templates = config['storage']['templates'].map{ |tpl| config['storage']['root'] + tpl } | |
cache = templates.map{ |tpl| Dir[tpl] }.inject(:+).keep_if{ |f| File.file?(f) } | |
cache = Hash[cache.map do |f| | |
l = config['storage']['root'].length |
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 session_user | |
@session_user ||= if current_user.admin? && params[:user_id].present? | |
User.find(params[:user_id]) | |
else | |
current_user | |
end | |
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
DELIMITER $$ | |
CREATE FUNCTION angle_point(lat double, lon double, deg double, dist double) RETURNS POINT DETERMINISTIC | |
BEGIN | |
DECLARE dist2 double; | |
DECLARE rdeg double; | |
DECLARE rlat1 double; | |
DECLARE rlon1 double; | |
DECLARE rlat2 double; | |
DECLARE rlon2 double; |
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
<?php | |
$config_file = "default.json"; | |
$config = json_decode(file_get_contents($config_file)); | |
$host = $config["default_host"]; | |
$uri = $_SERVER["QUERY_STRING"]; | |
if ($config["ab_enabled"]) { | |
if (in_array($_COOKIE["ab"], $config["ab_hosts"])) { | |
$host = $_COOKIE["ab"]; |
OlderNewer