the bash_profile
snippet will let you run the first file when you press tab
when you have empty command ,
you need to put the cmd
file in your path
and make it executable with chmod +x cmd
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
class ThreadPool | |
def self.execute(objects:, method:, pool: 5) | |
new(objects: objects, method: method, pool: pool).execute | |
end | |
def initialize(objects:, method:, pool:) | |
@objects = objects | |
@method = method | |
@pool = pool | |
@queue = queue |
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/env ruby | |
require 'tty-prompt' | |
require 'open-uri' | |
require 'json' | |
require 'colorize' | |
require 'colorized_string' | |
prompt = TTY::Prompt.new | |
user_name = prompt.ask("What is name of the user or organisation?") |
this script will read every line (file path) passed to it, then shows the last commit message and time (human readable period), you can use it to see who added png images and when to your project for example:
git ls-files | grep png | git-last-commit
you can get some results similar to the following:
images/screenshot.png
digitalcraftsman: Updated screenshots -- 3 years, 11 months ago
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
. | |
├── app | |
│ ├── assets | |
│ │ ├── config | |
│ │ │ └── manifest.js | |
│ │ ├── images | |
│ │ ├── javascripts | |
│ │ │ └── application.js | |
│ │ └── stylesheets | |
│ │ └── application.css |
Docker+zookeeper image https://hub.docker.com/r/spotify/kafka/
to run docker+zookeeper
docker run -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=0.0.0.0 --env ADVERTISED_PORT=9092 spotify/kafka
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/env ruby | |
require 'tty-prompt' | |
require 'open-uri' | |
require 'json' | |
require 'colorize' | |
require 'colorized_string' | |
prompt = TTY::Prompt.new | |
user_name = prompt.ask("What is name of the user or organisation?") |
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/env ruby | |
require 'io/console' | |
require 'bundler/inline' | |
gemfile do | |
gem 'net-ssh', require: 'net/ssh' | |
gem 'colorize', require: %w[colorize colorized_string] | |
end | |
DEFAULT_LINE_WIDTH = 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
input { | |
jdbc { | |
jdbc_driver_library => "drivers/postgresql-42.2.5.jar" | |
jdbc_driver_class => "org.postgresql.Driver" | |
jdbc_connection_string => "${DATABASE_URL}" | |
jdbc_user => "postgres" | |
schedule => "* * * * *" | |
statement => "SELECT * from rss_items where id > :sql_last_value order by id asc limit 100000" | |
use_column_value => true | |
tracking_column => "id" |
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/env erbview | |
<% | |
require 'redcarpet' | |
file = File.read(ARGV.shift) | |
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true) | |
output = markdown.render(file) | |
%> | |
<!DOCTYPE html> | |
<html> | |
<head> |