Skip to content

Instantly share code, notes, and snippets.

View cmiles74's full-sized avatar

Christopher Miles cmiles74

View GitHub Profile
@cmiles74
cmiles74 / cry-face.sql
Created November 30, 2017 20:58
An Index That Does Something
select FACULTY.FirstName, FACULTY.LastName, STUDENT.FirstName, STUDENT.LastName
from FACULTY, STUDENT
where FACULTY.FacultyID = STUDENT.AcademicAdvisorID and FACULTY.LastName = 'Leto';
----
Plan hash value: 1096367573
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
@cmiles74
cmiles74 / align-output.txt
Created September 14, 2017 16:34
Align Test 2
[cmiles@atari test]$ g++ -Wall -std=gnu++11 -fwrapv -O2 -o align align.cpp
align.cpp: In function ‘void func()’:
align.cpp:7:36: warning: requested alignment 256 is larger than 8 [-Wattributes]
alignas(256) unsigned char toot[7];
^
[cmiles@atari test]$ ./align
000000007efc274c
[cmiles@atari test]$
@cmiles74
cmiles74 / align-output.txt
Created September 14, 2017 16:12
Align Test
[cmiles@atari test]$ g++ -Wall -std=gnu++11 -fwrapv -O2 -o align align.cpp
align.cpp: In function ‘void func()’:
align.cpp:7:36: warning: requested alignment 256 is larger than 8 [-Wattributes]
alignas(256) unsigned char toot[7];
^
[cmiles@atari test]$ ls
align align.cpp
[cmiles@atari test]$ ./align
000000007ea6175c
[cmiles@atari test]$
@cmiles74
cmiles74 / gist:49c91ee7ad04d6be8a59602545049acd
Created September 14, 2017 16:06
Mednafen Crash on Arch for Arm (Raspberry Pi 3)
Starting Mednafen 0.9.47
Build information:
Compiled with gcc 7.2.0
Compiled against zlib 1.2.11, running with zlib 1.2.11(flags=0x00000055)
Compiled against SDL 1.2.15, running with SDL 1.2.15
Running with libsndfile-1.0.28
Base directory: /home/cmiles/.mednafen
Emulation modules: nes snes gb gba pce lynx md pcfx ngp psx ssfplay vb wswan sms gg snes_faust pce_f
ast demo cdplay
mednafen: tests.cpp:831: void MDFN_TESTS_CPP::DoAlignmentChecks(): Assertion `(((unsigned long long)&
@cmiles74
cmiles74 / social.conf
Created April 5, 2017 20:36
Mastodon Configuration for Apache
<IfModule mod_ssl.c>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName social.example.com
@cmiles74
cmiles74 / docker-compose.yml
Created April 5, 2017 16:46
Mastodon Docker Compose
version: '2'
services:
db:
restart: always
image: postgres:alpine
volumes:
- /mnt/vol1/docker/mastodon/data/postgresl:/var/lib/postgresql/data
redis:
restart: always
image: redis:alpine
[cmiles-local@mysql-east home]$ ssh -v cmiles@localhost ls /
OpenSSH_7.4p1, OpenSSL 1.0.2j 26 Sep 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/cmiles-local/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/cmiles-local/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
[cmiles-local@mysql-east home]$ ssh -v cmiles@localhost
OpenSSH_7.4p1, OpenSSL 1.0.2j 26 Sep 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/cmiles-local/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/cmiles-local/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: Authentication succeeded (password).
Authenticated to localhost ([::1]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to localhost closed by remote host.
Connection to localhost closed.
@cmiles74
cmiles74 / working.clj
Last active September 14, 2016 14:29
More than one signature
(defn third
([lst]
(third (seq lst) 0))
([lst currentIndex]
(if (= (first lst) nil)
0
(if (= currentIndex 2)
(first lst)
(if (< currentIndex 2)
(third (rest lst) (+ currentIndex 1)))))))