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 bash | |
| # Drop everything from the scissors line down (git commit -v diff), | |
| # then strip comment lines | |
| msg=$(sed '/^# -\+ >8 -\+$/,$d' "$1" | grep -v '^#') | |
| subject=$(printf '%s' "$msg" | head -1) | |
| # Skip autosquash targets and merge commits — not subject to normal formatting | |
| if [[ "$subject" =~ ^(fixup|squash|amend)\!\ ]] || [[ "$subject" == Merge\ * ]]; then | |
| exit 0 |
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
| require "digest" | |
| require "rack" | |
| # This class encapsulates a unit of work done for a particular tenant, connected to that tenant's database. | |
| # ActiveRecord makes it _very_ hard to do in a simple manner and clever stuff is required, but it is knowable. | |
| # | |
| # What this class provides is a "misuse" of the database "roles" of ActiveRecord to have a role per tenant. | |
| # If all the tenants are predefined, it can be done roughly so: | |
| # | |
| # ActiveRecord::Base.legacy_connection_handling = false if ActiveRecord::Base.respond_to?(:legacy_connection_handling) |
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
| #!/bin/bash | |
| # Production Docker Host Hardening Script v2 | |
| # For Ubuntu Server 26.04 LTS (Resolute) | |
| # Suitable for both Kamal deployment and builder hosts | |
| # | |
| # Usage: | |
| # curl -fsSL https://gist.githubusercontent.com/timcase/be550d75c5071ab7651a76f601a120a1/raw/kamal-production-server-setup.sh | sudo bash | |
| set -euo pipefail |
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
| { | |
| "name": "prometheus_node", | |
| "json_class": "Chef::Role", | |
| "default_attributes": { | |
| "twodrops_prometheus": { | |
| "components": { | |
| "node_exporter": { | |
| "install?": true, | |
| "cli_opts": { | |
| "collector.systemd": "", |
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
| INSIDE OF .taskrc: | |
| report.monwait.columns=id,start.active,project,tags,wait,wait.remaining,due,until,description | |
| report.monwait.description=tasks sorted by due date ascending | |
| report.monwait.filter=wait:mon | |
| report.tuewait.columns=id,start.active,project,tags,wait,wait.remaining,due,until,description | |
| report.tuewait.description=tasks sorted by due date ascending | |
| report.tuewait.filter=wait:tue |
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
| def print_bill | |
| outstanding = 0.0 | |
| #print banner | |
| puts "*************************" | |
| puts "******Customer Owes******" | |
| puts "*************************" | |
| # calculate outstanding |
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
| var React = require('react'); | |
| var ReactDOM = require('react-dom'); | |
| // var $ = require('jquery'); | |
| module.exports = { | |
| propTypes: { | |
| onSubmit: React.PropTypes.func.isRequired | |
| }, |
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
| var React = require('react'); | |
| module.exports = React.createClass({ | |
| displayName: 'TextField', | |
| propTypes: { | |
| label: React.PropTypes.string.isRequired, | |
| value: React.PropTypes.string.isRequired, | |
| }, |
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
| var React = require('react'); | |
| var DialogMixin = require('../mixins/DialogMixin'); | |
| var StringField = require('../fields/StringField'); | |
| var TextField = require('../fields/TextField'); | |
| var BooleanField = require('../fields/BooleanField'); | |
| var NumberField = require('../fields/NumberField'); | |
| var _ = require('lodash'); | |
| var reduxForm = require('redux-form').reduxForm; | |
| var Field = require('redux-form').Field; |
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
| handleCompletedClick = () => { | |
| const originalTodo = Object.assign({}, this.props.todo); | |
| let todo = this.props.todo; | |
| todo.completed = true | |
| this.props.update(todo, originalTodo); | |
| } | |
| export const updateTodo = (todo, originalTodo) => { | |
| const url = 'http://localhost:3001/todos/' + todo.id; |
NewerOlder