Skip to content

Instantly share code, notes, and snippets.

View Khaledgarbaya's full-sized avatar
😃
Smile

Khaled Garbaya Khaledgarbaya

😃
Smile
View GitHub Profile
@Khaledgarbaya
Khaledgarbaya / gist:aa0542ac8b1e3dbf4c78
Created June 19, 2014 09:33
Check if a dictionnary is empty in actionscript 3.0
function isDictionaryEmpty(dict:Dictionary):Boolean
{
for (var key:Object in dict)
{
return false;
}
return true;
}
@Khaledgarbaya
Khaledgarbaya / main.cpp
Last active August 29, 2015 14:07
SDL2 ,OPENGL, MacOSX Starting Point
#include <iostream>
#include <stdio.h>
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include "SDL2/SDL.h"
using namespace std;
#define PROGRAM_NAME "Hello OpenGL"
@Khaledgarbaya
Khaledgarbaya / main.cpp
Created October 2, 2014 15:40
SDL2 ,OPENGL ES, IOS Starting Point
#include "SDL.h"
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#include <memory>
using namespace std;
class Graphics
{
private:
@Khaledgarbaya
Khaledgarbaya / Hello_Triangle.cpp
Created October 4, 2014 22:28
Hello Triangle Sample With SDL in OpenGL ES 2 (IOS)
#include "SDL.h"
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#include <iostream>
#include <string>
#include <memory>
using namespace std;
GLuint programObject;
class Graphics
@Khaledgarbaya
Khaledgarbaya / webgl.js
Created December 10, 2014 16:24
Get WebGL context
var myCanvas = document.getElementById("canvas");
var context = getWebGL(myCanvas);
function getWebGL (canvas) {
var glContexts = ["experimental-webgl", "webgl"];
for (var i = glContexts.length - 1; i >= 0; i--) {
try {
gl = canvas.getContext(glContexts[i]);
gl.viewportWidth = canvas.width;
@Khaledgarbaya
Khaledgarbaya / go_links.md
Last active September 19, 2016 17:03
Go lang useful links

Remove all docker containers

docker rm `docker ps -a -q`

Remove all docker images

docker rmi `docker images -a -q`
@Khaledgarbaya
Khaledgarbaya / clear-cache-circle-ci.md
Created February 15, 2017 22:43
Clear Circle CI cache
curl -X DELETE https://circleci.com/api/v1/project/:username/:project/build-cache?circle-token=:token
@Khaledgarbaya
Khaledgarbaya / contentful-import-delta-sync.md
Created October 5, 2017 11:08
import delta sync data using contentful-import
const spaceImport = require('contentful-import')
const client = require('contentful')

// Create a CDA client
const contentful = client.createClient({space: '<space-id>', accessToken: '<access-token>'})
// grab the delta sync

contentful.sync({nextSyncToken: '<delta-sync-token>'})
 .then(response =&gt; {
@Khaledgarbaya
Khaledgarbaya / GameServer.csharp
Created January 14, 2018 13:28
GameServer.csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace GameServer
{