curl -XDELETE localhost:9200/*
View common-domain-prefix-suffix-list.tsv
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
Rank | Type | Prefix/Suffix | |
---|---|---|---|
1. | Prefix | my+ | |
2. | Suffix | +online | |
3. | Prefix | the+ | |
4. | Suffix | +web | |
5. | Suffix | +media | |
6. | Prefix | web+ | |
7. | Suffix | +world | |
8. | Suffix | +net | |
9. | Prefix | go+ |
View elasticsearch-es-delete-all-data.md
View checklist.md
- Additional keyboard
- New Github/Gitlab certificate, or copy existing
- MP3s
- Videos
- Txts with notes
- Documents
- Sublime text https://www.sublimetext.com/3, license, settings, package manager, and packages
- Atom editor, settings, package manager, and packages
- Other projects
- /etc/host https://github.com/StevenBlack/hosts
View rack_gc_heap_instrumentation.rb
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 'statsd' | |
class RackGcHeapInstrumentation | |
def initialize(app) | |
@app = app | |
@statsd = Statsd.new('localhost', 8125) | |
end | |
def call(env) | |
GC.enable # Ensure garbage colletion is enabled | |
ret = @app.call(env) |
View gist:55cea96ff08dd30af611
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
things.sort_by do |thing| | |
-((thing.created_at.to_f / Time.now.to_f) * rand) | |
end |
View node-exports-styles.js
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
// Style 1 | |
// Export all manually | |
// Good: Calling functions inside the module is convenient | |
// Bad: module.exports becomes verbose and it's tedious to add new functions | |
function a() { | |
b() | |
} |
View ansible_conditionals_examples.yaml
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
--- | |
# This has been tested with ansible 1.3 with these commands: | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
# NB: The type of the variable is crucial! | |
- name: Ansible Conditionals Examples | |
hosts: $hosts | |
vars_files: |
View remotepaste.md
Local (OS X) Side
~/Library/LaunchAgents/pbcopy.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>localhost.pbcopy</string>
View Explanation.md
Rails has a handy truncate helper (which is actually mostly a method added to String ), but it warns you it's not safe to use on html source, it'll cut off end tags and such.
What if you want an HTML safe one? There are a variety of suggested solutions you can google, none of which were quite robust/powerful enough for me.
So I started with my favorite, by Andrea Singh, using nokogiri.
But:
- I modified it to not monkey-patch Nokogiri, but be a static method instead (sadly making already confusing code yet more confusing, but I didn't want to monkey patch nokogiri)
View pedantically_commented_playbook.yml
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
This playbook has been removed as it is now very outdated. |
NewerOlder