Skip to content

Instantly share code, notes, and snippets.

$ ruby beau.rb
Let's practice everything.
You'd need to know 'bout escapes with \ that do
newlines and tabs.
--------------
The lovely world
with logic so firmly planted
cannot discern
the needs of love
nor comprehend passion from intuition
@jhgaylor
jhgaylor / count_children.js
Created June 13, 2016 16:55
Does your brain hurt when you think of trees? Mine too... I don't ever want to write this again.
function countChildren (node) {
function _countChildren (node) {
if (node.children) {
return node.children.map((child) => {
return _countChildren(child);
}).reduce((memo, next) => {
return memo + next;
}, 1);
}
return 1;
all: hello
hello: main.o factorial.o hello.o
g++ main.o factorial.o hello.o -o hello
main.o: main.cpp
g++ -c main.cpp
factorial.o: factorial.cpp
g++ -c factorial.cpp

Keybase proof

I hereby claim:

  • I am jhgaylor on github.
  • I am jhgaylor (https://keybase.io/jhgaylor) on keybase.
  • I have a public key ASBAtvWD5X5UkRIrdsL5GBueOfiYfE9n_OLC8FeuANWYoAo

To claim this, I am signing this object:

log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender.
log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender.
log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender.
[2016-01-15 03:02:08,126][INFO ][node ] [Bevatron] version[2.1.0], pid[12], build[72cd1f1/2015-11-18T22:40:03Z]
[2016-01-15 03:02:08,126][INFO ][node ] [Bevatron] initializing ...
[2016-01-15 03:02:08,384][INFO ][plugins ] [Bevatron] loaded [cloud-kubernetes], sites []
[2016-01-15 03:02:08,407][INFO ][env ] [Bevatron] using [1] data paths, mounts [[/data (/dev/sda9)]], net usable_space [75gb], net total_space [94.5gb], spins? [possibly], types [ext4]
[2016-01-15 03:02:10,535][INFO ][node ] [Bevatron] initialized
[2016-01-15 03:02:10,535][INFO ][node ] [Bevatron] starting ...
[2016-01-15 03:02:10,756][INFO ][transport
@jhgaylor
jhgaylor / get.incoming.twilio.js
Created November 25, 2015 20:14
hello-twilio-meteor
var getTwilioMessages = Meteor.wrapAsync(twilioClient.client.messages.list, twilioClient.client.messages);
function updateMessages () {
getTwilioMessages(function (err, data) {
if (err) {
console.warn("There was an error getting data from twilio", err);
return
}
data.messages.forEach(function (message) {
if (SMS.find({sid: message.sid}).count() > 0) {
<p>
<strong>Foo Name</strong>
</p>
<p>
<strong>Skills</strong>
</p>
<ul>
<li>HTML</li>
</ul>
var userChoice = prompt("Please choose rock, paper, or scissors");
var computerChoice = Math.random();
if(computerChoice >=0 && computerChoice<0.33){
computerChoice = "rock";
}
else if((computerChoice > 0.33) && (computerChoice<0.67)){
computerChoice = "scissors";
}
// never do an if/else without {}. It's a lie that it is is allowed. NO! Just don't do it! It's like cake.
else {
@jhgaylor
jhgaylor / client_methods.js
Last active November 19, 2015 06:09
An accompaniment for a blog post on blog.JakeGaylor.com where we help Frank's gym.
client.save = function (callback) {
if (client._id) {
collection.updateOne({_id: client._id}, client, callback);
} else {
collection.insertOne(client, callback);
}
}
client.recordResponse = function (response, callback) {
if (client.wasSentSMS.monthThree) {
response.milestone = "monthThree";
```
$ kubectl stop rc project-api-controller --v=10
I1110 16:35:54.355697 2892 debugging.go:102] curl -k -v -XGET -H "User-Agent: kubectl/v1.0.6 (linux/amd64) openshift/403de38" http://localhost:8080/oapi
I1110 16:35:54.357250 2892 debugging.go:121] GET http://localhost:8080/oapi 404 Not Found in 1 milliseconds
I1110 16:35:54.357266 2892 debugging.go:127] Response Headers:
I1110 16:35:54.357273 2892 debugging.go:130] Content-Type: application/json
I1110 16:35:54.357279 2892 debugging.go:130] Date: Tue, 10 Nov 2015 23:35:54 GMT
I1110 16:35:54.357285 2892 debugging.go:130] Content-Length: 183
I1110 16:35:54.357317 2892 request.go:777] Response Body: {
"paths": [