Skip to content

Instantly share code, notes, and snippets.

View chrisl8's full-sized avatar
🤖
Trying to human

Christen Lofland chrisl8

🤖
Trying to human
View GitHub Profile
@chrisl8
chrisl8 / startup.gd
Created September 14, 2023 13:57 — forked from CrankyBunny/startup.gd
Determine the instance number for Godot run multiple instances feature
var _instance_num := -1
var _instance_socket: TCPServer
func _init() -> void:
if OS.is_debug_build():
_instance_socket = TCPServer.new()
for n in range(0,4):
if _instance_socket.listen(5000 + n) == OK:
_instance_num = n
break
@chrisl8
chrisl8 / keybase.md
Last active February 13, 2020 20:40

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@chrisl8
chrisl8 / per_robot_settings_for_propeller_c_code.h
Created May 31, 2016 14:51
Settings for Robot with 4 Ping sensors
/* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION!
You MUST edit the following settings based on the physical layout
of your robot!
For each QUESTION:
UNCOMMENT '#define' lines for any included items,
COMMENT '#define' lines for anything that is not included.
For each SETTING:
Set the variable as required, noting that usually these are ignored if the preceding QUESTION is commented out.
Example, My robot has a "Thing1", but not a "Thing2"
@chrisl8
chrisl8 / getTweetsFor.js
Created September 17, 2015 21:37
Simple Promise example from the web
// Source: https://gist.github.com/domenic/3889970
// Just sticking the parts in one spot and playing with them.
function getTweetsFor() {
var ajaxOptions = {
url: '...',
...
};
return new RSVP.Promise(function(resolve, reject) {
@chrisl8
chrisl8 / index.js
Last active September 17, 2015 16:05
SQl Pool in Node.js
var sqlTable = require('./sqlTable');
function insertIntSqlTable(aThing) {
'use strict';
sqlTable.pool.query('INSERT INTO aTable (things) VALUES (?)', [aThing], function(err, rows, fields) {
if (err) console.log('SQL Error: ' + err);
});
}
@chrisl8
chrisl8 / gist:99c16e545a8d96b5784e
Created January 27, 2015 17:18
Center Text and Media Query
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test Junk</title>
<meta charset="utf-8">
<style>
@media (max-width: 800px) {
#hideme {
display: none;
}