| description |
|---|
Initialize the Feature Design (FD) tracking system in any project |
Set up a lightweight feature tracking system in the current project. Creates directory structure, index, templates, slash commands, and CLAUDE.md conventions.
| // One of my new favorite React Hook patternms is to create handler | |
| // functions for a custom hook using `React.useMemo` instead of | |
| // `React.useCallback`, like so: | |
| function useBool(initialState = false) { | |
| const [state, setState] = React.useState(initialState) | |
| // Instead of individual React.useCallbacks gathered into an object | |
| // Let's memoize the whole object. Then, we can destructure the | |
| // methods we need in our consuming component. |
| INSTALL JAVA | |
| $ sudo apt-get update && sudo apt-get install default-jre | |
| INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html | |
| $ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
| $ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
| $ sudo apt-get update && sudo apt-get install elasticsearch | |
| $ sudo update-rc.d elasticsearch defaults 95 10 | |
| $ sudo service elasticsearch restart | |
| $ sudo service elasticsearch status |
| var http = require('https'); | |
| var querystring = require('querystring'); | |
| // set the post request options | |
| var reqOptions = { | |
| hostname: 'hooks.slack.com', | |
| port: 443, | |
| path: '/services/YOUR/SLACK/HOOK_HERE', | |
| method: 'POST' | |
| }; |
| <?php | |
| const PASSWORD = '!!!!!sufficiently_long_password!!!!!'; | |
| const CIPHER_METHOD = 'AES-256-CBC'; | |
| function encrypt($str) { | |
| $iv_length = openssl_cipher_iv_length(CIPHER_METHOD); | |
| $iv = mcrypt_create_iv($iv_length, MCRYPT_RAND); | |
| $str = $iv.$str; | |
| $val = openssl_encrypt($str, CIPHER_METHOD, PASSWORD, 0, $iv); |
| # Sidekiq interaction and startup script | |
| commands: | |
| create_post_dir: | |
| command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post" | |
| ignoreErrors: true | |
| files: | |
| "/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh": | |
| mode: "000755" | |
| owner: root | |
| group: root |
| require 'rails_helper' | |
| RSpec.describe TodosController, :type => :controller do | |
| describe "GET #index" do | |
| #describe "POST #create" do | |
| #describe "GET #show" do | |
| #describe "PATCH #update" do (or PUT #update) | |
| #describe "DELETE #destroy" do | |
| #describe "GET #new" do |
| <?php | |
| /** | |
| * Insert an attachment from a URL address. | |
| * | |
| * @param string $url The URL address. | |
| * @param int|null $parent_post_id The parent post ID (Optional). | |
| * @return int|false The attachment ID on success. False on failure. | |
| */ | |
| function wp_insert_attachment_from_url( $url, $parent_post_id = null ) { |
| # Install Git needed for Git based gems | |
| packages: | |
| yum: | |
| git: [] | |