Skip to content

Instantly share code, notes, and snippets.

@glasses618
glasses618 / cors-example-2.html
Last active June 20, 2021 13:25
CORS Example 2
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<img src="https://someawscdn.cloudfront.net/image.png">
<script>
setTimeout(function () {
var oReq = new XMLHttpRequest();
@glasses618
glasses618 / cors-example.html
Last active June 20, 2021 12:51
CORS Example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<img src="https://someawscdn.cloudfront.net/image.png">
<script>
setTimeout(function () {
var oReq = new XMLHttpRequest();
@glasses618
glasses618 / new_pry_config.rb
Created June 26, 2020 02:57
pry prompt after v0.13.0
unless Rails.env.development?
default_prompt = Pry::Prompt[:default]
env = Pry::Helpers::Text.red(Rails.env.upcase)
Pry.config.prompt = Pry::Prompt.new(
'custom',
'my custom prompt',
[
proc{ |*args| "#{env} #{default_prompt.wait_proc.call(*args)}" },
proc{ |*args| "#{env} #{default_prompt.incomplete_proc.call(*args)}" },
],
@glasses618
glasses618 / old_pry_config.rb
Created June 26, 2020 02:49
pry prompt before v0.13.0
# config/initializers/pry.rb
# Show red environment name in pry prompt for non development environments
unless Rails.env.development?
old_prompt = Pry.config.prompt
env = Pry::Helpers::Text.red(Rails.env.upcase)
Pry.config.prompt = [
proc {|*a| "#{env} #{old_prompt.first.call(*a)}"},
proc {|*a| "#{env} #{old_prompt.second.call(*a)}"},
]
@glasses618
glasses618 / vimrc
Last active July 6, 2017 03:19
vimrc-vundle
" http://erikzaadi.com/2012/03/19/auto-installing-vundle-from-your-vimrc/
" Setting up Vundle - the vim plugin bundler
let iCanHazVundle=1
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/VundleVim/Vundle.vim ~/.vim/bundle/vundle
let iCanHazVundle=0