Skip to content

Instantly share code, notes, and snippets.

View HopperMCS's full-sized avatar

G. F. Hopper HopperMCS

View GitHub Profile
@HopperMCS
HopperMCS / test.rs
Last active April 28, 2017 18:25
Rust Test
fn to_rgb(r: f32, g: f32, b: f32) {
let r0: f32 = r * 255.0;
let g0: f32 = g * 255.0;
let b0: f32 = b * 255.0;
let r1: f32 = r0.round();
let g1: f32 = g0.round();
let b1: f32 = b0.round();
println!("Original RGB values before Cairo: ({}, {}, {})", r1, g1, b1);
@HopperMCS
HopperMCS / logo.vala
Last active April 25, 2017 18:25
After C#, learned an easy way to write this cairo sh!t without reinventing fourteen wheels
using Cairo;
public class Main : GLib.Object {
public static void Triangle1p1() {
// Create a context:
Cairo.SvgSurface triangle_surface_1p2 = new Cairo.SvgSurface ("triangle1p1.svg", 421, 410);
Cairo.Context triangle_context_1p2 = new Cairo.Context (triangle_surface_1p2);
Cairo.Context triangle_context_1p3 = new Cairo.Context (triangle_surface_1p2);
Cairo.Context triangle_context_1p4 = new Cairo.Context (triangle_surface_1p2);
Cairo.Context triangle_context_1p5 = new Cairo.Context (triangle_surface_1p2);
https://www5.sos.state.oh.us/ords/f?p=100:7:0::NO:7:P7_CHARTER_NUM:4001046
.content1{
}
.content1{
}
.content1{
@HopperMCS
HopperMCS / output.txt
Created February 24, 2017 19:20
Sample output using contents of AssetsApplication
[mgagemorgan@localhost AssetsApplication]$ python cairo_rgb_calc.py
Enter the R value to be converted: 0.7
Enter the G value to be converted: 0.20
Enter the B value to be converted: 0.17
Before Cairo, the original RGB values are: 178, 51, 43.
Enter the R value to be converted: 178
Enter the G value to be converted: 51
Enter the B value to be converted: 43
cairo_set_source_rgba(0.7, 0.2, 0.17, 0.8);
@HopperMCS
HopperMCS / cairo_colors.py
Last active February 24, 2017 19:21
For converting between RGB and Cairo's fucked up version of it
def toCairo():
print " Enter the R value to be converted.\n";
r_one = float(raw_input(" >> "));
print "\n"
print " Enter the G value to be converted.\n";
g_one = float(raw_input(" >> "));
print "\n"
print " Enter the B value to be converted.\n";
.jumbotron
.jumbotron
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js" integrity="sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK" crossorigin="anonymous"></script>
<link rel="stylesheet" href="styles.css">
<div class="container jumbotron">
<h1 class="display-3">Hello, world!</h1>
<p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<hr class="my-2">
<p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
<p class="lead">
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkAssistant">
<property name="can_focus">False</property>
<property name="use_header_bar">1</property>
<signal name="apply" handler="next" swapped="no"/>
<child>
<object class="GtkBox">