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
server { | |
listen 80; | |
server_name map.geekya.com; | |
# I normally wouldn't disable the access log but here I see no problem with it | |
access_log off; | |
error_log /var/log/nginx/com.geekya.map.error.log; | |
# custom error page when map isn't available | |
error_page 502 503 504 =503 /503_map.html; |
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 | |
# > vban-autoswitch | |
# Switches between two audio devices depending on process presence and other conditions. | |
# | |
# @dependency SwitchAudioSource (brew install switchaudio-osx) | |
# | |
# Configuration is at the end of this file! | |
# | |
# Note: This must be running to work obviously. |
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
Airbrake.configure do |config| | |
# project specific | |
config.project_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
# use git SHA & current commit as app version | |
config.app_version = "Ruby: #{RUBY_VERSION} » Rails: #{Rails::VERSION::STRING} » " << `cd #{Rails.root} && git log -1 --pretty="%h - %B" HEAD` | |
# can always be 1 | |
config.project_id = 1 |
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
#!/bin/sh | |
mkdir -p ~/.vim/syntax/ | |
cd ~/.vim/syntax/ | |
wget http://www.vim.org/scripts/download_script.php?src_id=19394 | |
mv download_script.php\?src_id\=19394 nginx.vim | |
cat > ~/.vim/filetype.vim <<EOF | |
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif | |
EOF |
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
Airbrake.configure do |config| | |
# project specific | |
config.project_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
# use git SHA & current commit as app version | |
# Looks like this: | |
# Ruby: 2.7.0 » Rails: 6.0.2.2 » f98b36585 - Only try to remove fade from modals if jQuery is there | |
config.app_version = "Ruby: #{RUBY_VERSION} » Rails: #{Rails::VERSION::STRING} » " << `cd #{Rails.root} && git log -1 --pretty="%h - %B" HEAD` | |
# can always be 1 |
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 Product < ApplicationRecord | |
fuzzily_searchable :search_name, class_name: "ProductTrigram" | |
def search_name | |
term = [name, name_origin, *search_terms.try(:split, ",")].join(" ") | |
term = FuzzilyStringConverter.convert_in_string(term) | |
term.split(" ").uniq.join(" ") | |
end | |
def saved_change_to_search_name? |
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
################################## | |
### SCROLL DOWN FOR AN EXAMPLE ### | |
################################## | |
module Enumerable | |
# your each_with_position method | |
def each_pos &block | |
EachWithPosition.each(self, &block) | |
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
# add source | |
cat >> /etc/apt/sources.list <<EOF | |
# Nginx | |
deb http://nginx.org/packages/ubuntu/ disco nginx | |
deb-src http://nginx.org/packages/ubuntu/ disco nginx | |
EOF | |
# add signing key | |
curl http://nginx.org/packages/keys/nginx_signing.key | sudo apt-key add - |
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 AppOS.Component.Recaptcha3 extends AppOS.Component | |
name: "recaptcha" | |
API_URL: "https://www.google.com/recaptcha/api.js?onload=%callback&render=explicit" | |
API_KEY: "MY_PUBLIC_SITEKEY" | |
init: -> | |
@pending = [] | |
@apiState = "unloaded" | |
# init event |
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
# create_table "codenames", force: true do |t| | |
# t.integer "user_id" | |
# t.string "name" | |
# t.datetime "created_at" | |
# t.datetime "updated_at" | |
# end | |
# add_index "codenames", ["name"], name: "index_codenames_on_name", unique: true, using: :btree | |
# add_index "codenames", ["user_id"], name: "index_codenames_on_user_id", unique: true, using: :btree | |
class Codename < ActiveRecord::Base |
NewerOlder