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
| require 'rubygems' | |
| require 'json' | |
| require 'httparty' | |
| require 'active_record' | |
| require 'pry' | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => 'mysql2', | |
| :database => 'lol', | |
| :username => 'yourusername', |
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
| ActiveSupport::Notifications.subscribe "sql.active_record" do |name, started, finished, unique_id, data| | |
| Thread.current["active_record_sql_count"] ||= 0 | |
| if data[:name].nil? || data[:name] != "SCHEMA" | |
| Thread.current["active_record_sql_count"] = Thread.current["active_record_sql_count"] + 1 | |
| end | |
| end | |
| ActiveSupport::Notifications.subscribe "process_action.action_controller" do |name, started, finished, unique_id, data| | |
| time = Time.now | |
| slow_logfile = File.open(Rails.root.join("log", "slow.log"), 'a') |
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
| $.ajax({ | |
| url:"http://uncreative.korny.cc:8888/", | |
| type: "POST", | |
| data: JSON.stringify({ | |
| id: encodeURIComponent($('.post_title').text()), | |
| title:$('.post_title').text(), | |
| text:$('.post_content').text() | |
| .replace(/[^"':;/!?.>,<\[\]{}\-=\+\(\)|!@#$%^&*~`\u2019\u201C\u201D\w]/g," ") | |
| .replace(/([.,!?])[\s]*([^\s])/g,"$1 $2") | |
| .replace(/\s+/g," ") |
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
| @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,300&subset=latin,greek); | |
| @import "compass"; | |
| @import "compass/utilities/sprites/base"; | |
| @import "font-awesome"; | |
| @import "front/variables"; | |
| @import "front/override"; | |
| @import "front/general"; | |
| @import "front/header"; | |
| @import "front/horizontal_menu"; |
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
| // Colors | |
| $base_color: #FFE403; | |
| $base_hover_color: #FFFF00; | |
| $second_color: #272727; | |
| $second_hover_color: #555; | |
| // Fonts | |
| $font_one: 'Open Sans', sans-serif; | |
| // Sprites |
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
| auto lo | |
| iface lo inet loopback | |
| auto eth0 | |
| iface eth0 inet static | |
| address 192.168.1.51 | |
| netmask 255.255.255.0 | |
| gateway 192.168.1.1 | |
| dns-nameservers 8.8.8.8 |
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
| bet1 = 2.25 | |
| bet2 = 3.15 | |
| bet3 = 3.15 | |
| puts "#{(1 - 1/(1/bet1 + 1/bet2 + 1/bet3)) * 100}%" |
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
| #!/usr/bin/ruby | |
| require 'aws-sdk' | |
| require 'mail' | |
| # The filename for using it during the script and the location | |
| filename = "#{Time.now.to_s.split(" ").first}_data_only_dump.sql" | |
| store_location = "/home/your_user/your_backups/#{filename}" | |
| # Local backup of a postgres database | |
| `pg_dump -U your_user your_db_name -f #{store_location} --data-only` |
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
| .groups{ng_repeat: "row in [] | skip_range:0:keyword_groups.length-1:3"} | |
| .group{ng_repeat: "keyword_group in [] | range:row*3:((row+1)*3)-1:keyword_groups"} |
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
| set daemon 30 | |
| set logfile /var/log/monit.log | |
| set idfile /var/lib/monit/id | |
| set statefile /var/lib/monit/state | |
| set eventqueue | |
| basedir /var/lib/monit/events # set the base directory where events will be stored | |
| slots 100 # optionally limit the queue siz | |
| set httpd port 2812 | |
| allow 0.0.0.0/0.0.0.0 | |
| allow username:password |