Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
RAW_STATUS=$(python3 ~/src/starlink-grpc-tools/dish_grpc_text.py -s 2 status)
STARLINK_CONNECTED=$(echo "$RAW_STATUS" | cut -f 5 -d',')
if [[ "${STARLINK_CONNECTED}" == "CONNECTED" ]]; then
STARLINK_CONNECTED='${color green}'"CONNECTED"'${color}'
elif [[ "${STARLINK_CONNECTED}" == "OFFLINE" ]]; then
STARLINK_CONNECTED='${color red}'"OFFLINE"'${color}'
else
STARLINK_CONNECTED='${color yellow}'"${STARLINK_CONNECTED}"'${color}'
@aditya
aditya / accounting.sql
Created September 15, 2021 04:39 — forked from 001101/accounting.sql
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
Adityas-MacBook-Air% rake vm:symfony:rebuild ~/code/ted/ted.com
Pseudo-terminal will not be allocated because stdin is not a terminal.
PHP Warning: require_once(/vagrant): failed to open stream: No such file or directory in /vagrant/config/ProjectConfiguration.class.php on line 2
PHP Stack trace:
PHP 1. {main}() /vagrant/symfony:0
PHP 2. require_once() /vagrant/symfony:13
PHP Fatal error: require_once(): Failed opening required '' (include_path='.:/usr/share/pear:/usr/share/php') in /vagrant/config/ProjectConfiguration.class.php on line 2
PHP Stack trace:
PHP 1. {main}() /vagrant/symfony:0
PHP 2. require_once() /vagrant/symfony:13
00:09 < stitch> tweetalkie: someone else can answer your question. you have
clearly demonstrated you are in no position to write code as
you don't even know the basic steps to take when things go wrong
00:10 < stitch> tweetalkie: good luck in life
13:45 -!- ferric [~adityacha@static-64-61-84-78.isp.broadviewnet.net] has
joined #flora
13:45 -!- ServerMode/#flora [+ns] by anthony.freenode.net
13:45 [Users #flora]
13:45 [@ferric]
13:45 -!- Irssi: #flora: Total of 1 nicks [1 ops, 0 halfops, 0 voices, 0 normal]
13:45 -!- Channel #flora created Mon Feb 8 13:45:54 2010
13:45 -!- Irssi: Join to #flora was synced in 0 secs
13:45 -!- ServerMode/#flora [-o ferric] by services.
13:45 !anthony.freenode.net *** Notice -- TS for #flora changed from 1265654754
def freeze_time(*times)
if times.empty?
times << Time.at(Time.now.to_i) # Truncate seconds
end
Time.stubs(:now).returns(*times)
end
s = "mutable"
arr = [s]
hsh = { arr => "object" }
s.upcase!
p hsh[arr] # -> nil (maybe not what was expected)
hsh.rehash
p hsh[arr] # -> "object"
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 groupped groupped.localhost
127.0.0.1 localhost subdomain1.localhost subdomain2.localhost www.localhost
>> class Foo
>> def bar=(a = nil, b = nil)
>> @bar = "#{a}#{b}"
>> end
>> end
=> nil
>> f = Foo.new
=> #<Foo:0x5f3390>
>> f.bar = 5,10
=> [5, 10]
config.load_paths += Dir["#{RAILS_ROOT}/vendor/gems/**"].map do |dir|
File.directory?(lib = "#{dir}/lib") ? lib : dir
end