This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From my other gist: https://gist.github.com/Miqueas/c52a7f6684036030572a66d1f58ba574 | |
Gtk.Grid build_grid() { | |
var grid = new Gtk.Grid() { | |
visible = true, | |
column_spacing = 6, | |
row_spacing = 6, | |
halign = Gtk.Align.CENTER, | |
valign = Gtk.Align.CENTER | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gtk/gtk.h> | |
GtkWidget *user, *pass, *confirm, *clear, *check; | |
GRegex *patt; | |
GtkWidget* build_grid() { | |
GtkWidget *label; | |
GtkWidget *grid = g_object_new( | |
GTK_TYPE_GRID, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Generates a constantly-changin number | |
-- Note: Lua 5.4 don't need this | |
math.randomseed(os.time()) | |
local MagicNum = math.random(100) | |
local Lives = 3 | |
print ("Guess the number!") | |
print ("Enter your choice:") | |
io.write("> ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "gtk3" | |
app = Gtk::Application.new "com.example.ruby-gtk3", :FLAGS_NONE | |
app.signal_connect :activate do |app| | |
head = Gtk::HeaderBar.new | |
head.visible = true | |
head.title = "Ruby GTK+ 3 example" | |
head.show_close_button = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
Fmt "fmt" | |
Time "time" | |
Rand "math/rand" | |
) | |
func main() { | |
// Makes a constantly-changing number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Magic number to guess | |
MagicNum = rand 100 | |
# User lives | |
lives = 3 | |
puts "Guess the number!\n" | |
puts 'Enter your choice:' | |
print '> ' | |
# User input | |
choice = gets.chomp.to_i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
Fmt "fmt" | |
Str "strings" | |
Bytes "bytes" | |
JSON "encoding/json" | |
) | |
// Our JSON string to decode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
// For printing | |
Fmt "fmt" | |
// For arguments parsing | |
Flag "flag" | |
) | |
// Defines a flag for the commandline. Refers to the doc for details: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
// For the exit status | |
OS "os" | |
// For printing | |
Fmt "fmt" | |
// For commandline arguments | |
Flag "flag" | |
// For requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// We need only this modules | |
import ( | |
"os" // For open the file | |
"fmt" // For print data | |
"io/ioutil" // For read data | |
) | |
// A little function for error checking |