Summarizing the instructions of the pass
tool (as seen on its website).
Execute: $ sudo apt install pass
import { useState } from 'react'; | |
import { Trash2, Plus, Check } from 'lucide-react'; | |
export default function TodoApp() { | |
const [todos, setTodos] = useState([]); | |
const [input, setInput] = useState(''); | |
const addTodo = () => { | |
if (input.trim()) { | |
setTodos([...todos, { id: Date.now(), text: input, completed: false }]); |
import { useEffect, useMemo, useRef, useState } from "react"; | |
// Single-file React To‑Do app | |
// Features: add, edit, complete, delete, filter (All/Active/Completed), | |
// clear completed, reorder via drag, and localStorage persistence. | |
// Works out of the box in a Vite React template by replacing App.jsx. | |
const STORAGE_KEY = "todoapp.v1.items"; | |
function uid() { |
Summarizing the instructions of the pass
tool (as seen on its website).
Execute: $ sudo apt install pass
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'sinatra-contrib' |
Resque.queues.each do |q| | |
begin | |
# Resque.remove_queue_with_cleanup(q) | |
ResqueSolo::Queue.cleanup(q) | |
rescue => e | |
puts("#{e} for queue #{q}") | |
end | |
end |
Resque.reset_delayed_queue |
class Product | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
field :description, :type => String | |
field :price_pence, :type => Integer, :default => 0 | |
field :currency_iso, :type => String, :default => Money.default_currency.iso_code | |
validates_presence_of :description |
child_coll = Mongoid.database.collection('children') | |
Parent.all.each do |p| | |
p.childs.all.each do |c| | |
c.attributes['parent_id'] = p.id | |
child_coll.insert c.attributes # save children to separate collection | |
end | |
p.childs = nil # remove embedded data |
Resque::Failure.count.times do |i| | |
Resque::Failure.requeue(i) | |
end | |
Resque::Failure.clear |