- php
- python
- pip
| #include "person.h" | |
| int main(int argc, const char *argv[]) | |
| { | |
| person_t james = {"James", "Newton", 21}; | |
| person_print(james); | |
| return 0; | |
| } |
This is the third part of my [Learning code by comparison][1] series of learning C with explanations in Ruby.
It's always normal when writing a library, application, or other things in Ruby to use multiple files. It's common to do this with C too, but since we compile it's not as simple as our typical require.
To start off our Ruby example we'll create a Person module with common methods we'll want to include in our James class. This would allow us to give James extra methods that are unique to that class.
module Person
def full_name
"#{@first_name} #{@last_name}"I hereby claim:
To claim this, I am signing this object:
| require 'cocaine' |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <!-- Generated by: TmTheme-Editor --> | |
| <!-- ============================================ --> | |
| <!-- app: http://tmtheme-editor.herokuapp.com --> | |
| <!-- code: https://github.com/aziz/tmTheme-Editor --> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>gutterSettings</key> | |
| <dict> |
| describe 'imageDrop', -> | |
| element = | |
| $scope = | |
| beforeEach inject ($rootScope, $compile) -> | |
| $scope = $rootScope | |
| element = angular.element('<image-drop></image-drop>') | |
| $compile(element)($rootScope) | |
| $scope.$digest() |
| require 'centarra' | |
| manager = Centarra::Manager.new | |
| manager << Centarra::Account.new(name: 'carina', username: 'honk', key: 'honk') | |
| manager << Centarra::Account.new(name: 'orion', username: 'honk', key: 'honk') | |
| manager['carina'].vps_list | |
| manager['carina'].signup 'huehue' | |
| manager['orion'].dns # returns Centarra::DNS stuff, or whatever |
| <script> | |
| var script = document.createElement('script'); | |
| script.src = "//example.com"; | |
| document.getElementsByTagName('head')[0].appendChild(script); | |
| </script> | |
| <script async src="//example.com"></script> |