Skip to content

Instantly share code, notes, and snippets.

View samermurad's full-sized avatar

Samer Murad samermurad

View GitHub Profile
<!--
Go to Line 153 for the start of Uniform Buffer Object related code and intro
Prerequsite:
You at least know what uniforms are in the context of WebGL
and mininally understand the concepts involved in creating a square in WebGL
-->
<html>
@rufoa
rufoa / Jenkinsfile
Created May 13, 2019 02:29
Jenkins [skip ci] implementation for multi-branch declarative pipeline
// change 'agent' lines as appropriate
pipeline {
agent none
stages {
stage('Run CI?') {
agent any
steps {
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@shivshank
shivshank / vox_to_obj_exporter.py
Last active December 31, 2023 01:12
Exports from MagicaVoxel VOX to OBJ. Can preserve all edges for easy editing in a program like Blender.
"""
This script is designed to export a mass amount of MagicaVoxel .vox files
to .obj. Unlike Magica's internal exporter, this exporter preserves the
voxel vertices for easy manipulating in a 3d modeling program like Blender.
Various meshing algorithms are included (or to be included). MagicaVoxel
uses monotone triangulation (I think). The algorithms that will (or do)
appear in this script will use methods to potentially reduce rendering
artifacts that could be introduced by triangulation of this nature.
@omz
omz / File Picker.py
Created February 22, 2016 03:14
File Picker.py
# coding: utf-8
import ui
import os
from objc_util import ObjCInstance, ObjCClass
from operator import attrgetter
import time
import threading
import functools
import ftplib
import re
@galek
galek / pbr.glsl
Created November 4, 2015 11:10
PBR GLSL SHADER
in vec2 v_texcoord; // texture coords
in vec3 v_normal; // normal
in vec3 v_binormal; // binormal (for TBN basis calc)
in vec3 v_pos; // pixel view space position
out vec4 color;
layout(std140) uniform Transforms
{
mat4x4 world_matrix; // object's world position
@aldo-jlaurenstin
aldo-jlaurenstin / ALCommonHMAC.h
Created October 7, 2015 20:30
Objective-C sample code for HMAC-SHA1
//
// ALCommonHMAC.h
//
// As discussed in http://stackoverflow.com/questions/756492/objective-c-sample-code-for-hmac-sha1
//
// Created by James Laurenstin on 2015-15-09.
// Copyright (c) 2015 Aldo Group Inc. All rights reserved.
//
//
@MihaelIsaev
MihaelIsaev / HMAC.swift
Last active December 4, 2019 04:51
Easy to use Swift implementation of CommonCrypto HMAC. You can easily hash your String to: md5, sha1, sha224, sha256, sha384, sha512 with pure Swift.
//
// HMAC.swift
//
// Created by Mihael Isaev on 21.04.15.
// Copyright (c) 2014 Mihael Isaev inc. All rights reserved.
//
// ***********************************************************
//
// How to import CommonCrypto in Swift project without Obj-c briging header
//
@gskielian
gskielian / git-specify-ssh-key
Created October 14, 2014 16:51
Specifying SSH Key within Git Clone
#how to specify an ssh key to use when cloning a repo in Mac
ssh-agent bash -c 'ssh-add /Users/UR_USERNAME/.ssh/UR_PRIVATE_KEY; git clone git@DAS_GIT_URL'
@lastguest
lastguest / JSON_to_URLEncoded.js
Created July 10, 2014 17:47
Convert JavaScript object to x-www-form-urlencoded format
function JSON_to_URLEncoded(element,key,list){
var list = list || [];
if(typeof(element)=='object'){
for (var idx in element)
JSON_to_URLEncoded(element[idx],key?key+'['+idx+']':idx,list);
} else {
list.push(key+'='+encodeURIComponent(element));
}
return list.join('&');
}