This file contains 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
export EDITOR="vim" | |
function copy() { | |
pbcopy < $1 | |
} | |
fzf_edit() { | |
files=$1 | |
editor=$2 | |
query=$3 |
This file contains 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
-- Pseudo oversimplistic snake implementation to explore language syntax | |
-- Import multiple elements of the same package | |
import std.input { Key key_pressed } | |
-- Struct declaration | |
struct Canvas { height: Float width: Float } | |
struct Vec2 { x: Float y: Float } | |
struct Snake { |
This file contains 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
def read_int(stream, size=1): | |
return int.from_bytes(stream.read(size), byteorder='little') | |
class Node: | |
def __init__(self, stream): | |
self.material = read_int(stream) | |
self.distance = read_int(stream) | |
self.child = read_int(stream, 2) |
This file contains 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
//************** | |
// It works now, but theres some things that I don't get it yet | |
// like the texture faces in the UV mapping, theres no logic order (at least that I can understand) | |
//************** | |
// Texture image | |
// https://imgur.com/jwKWRBJ | |
let texture = #imageLiteral(resourceName: "texture") | |
// Half geometry size | |
let halfSide: Float = 0.5 |
This file contains 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
#!/bin/bash | |
# TODO: Research how to accomplish this when distributing the library through SPM | |
# TODO: Check linux OpenGL shader copy files | |
if [ "$(uname)" == "Darwin" ]; then | |
swift package generate-xcodeproj | |
SETTINGS="Enjin.xcodeproj/project.xcworkspace/xcuserdata/$USER.xcuserdatad/WorkspaceSettings.xcsettings" |
This file contains 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
// swift-tools-version:4.0 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
import PackageDescription | |
let package = Package( | |
name: "CLI", | |
products: [ | |
// Products define the executables and libraries produced by a package, and make them visible to other packages. | |
.executable( |
This file contains 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
class Demo { | |
var foo: String? = nil | |
var bar: String? = nil | |
init(block: (Demo) -> Void) { | |
block(self) | |
} | |
} | |
Demo { |
This file contains 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
<?php | |
function i18n($file = null) { | |
global $transtation; | |
$transtation = array(); | |
if (!isset($_SESSION['lang'])) $_SESSION['lang'] = 'en'; | |
if (!$file) $file = 'default'; | |