Skip to content

Instantly share code, notes, and snippets.

{
beforeSend: function (xhr, s) {
if (Object.prototype.toString.call(s.data).slice(8, -1) != 'FormData') {
s.data = csrfMagicName + '=' + csrfMagicToken + '&' + s.data;
} else {
s.data.append(csrfMagicName, csrfMagicToken);
}
}
}
<?php
$baz='hello!';
?>
@flagoworld
flagoworld / csb.php
Last active December 18, 2015 08:29 — forked from anonymous/gist:5754885
<?php
//ARRAY IN:
$in=array(
array('name' => 'john', 'occupation' => 'electrician'),
array('name' => 'jack', 'occupation' => 'plumber'),
array('name' => 'jake', 'occupation' => 'office rat'),
array('name' => 'pete', 'occupation' => 'electrician')
);
glBindTexture(GL_TEXTURE_2D,entity->model->texture->texture);
glUseProgram(entity->model->texture->shader->program);
glBindVertexArray(entity->model->vao);
glUniformMatrix4fv(entity->model->texture->shader->m_mvp,1,GL_FALSE,matrix_position(matrix,entity->pos.x,entity->pos.y,0,0,0,0));
glBindVertexArray(0);
glUseProgram(0);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D,texture);
glUniform1i(uni.texture,0);
glUniform1f(uni.seed,1.0/glfwGetTime());
glBindBuffer(GL_ARRAY_BUFFER,vbo);
glNormalPointer(GL_FLOAT,sizeof(OOKVertex),(void *)offsetof(OOKVertex,nor));
glVertexPointer(3,GL_FLOAT,sizeof(OOKVertex),(void *)offsetof(OOKVertex,pos));
glTexCoordPointer(2,GL_FLOAT,sizeof(OOKVertex),(void *)offsetof(OOKVertex,tex));
float coords[16]=
{
(float)rect.x,(float)rect.y,u1,v1,
(float)rect.x+rect.w,(float)rect.y,u2,v1,
(float)rect.x+rect.w,(float)rect.y+rect.h,u2,v2,
(float)rect.x,(float)rect.y+rect.h,u1,v2
};
glVertexPointer(2,GL_FLOAT,sizeof(float)*4,(void *)&coords[0]);
glTexCoordPointer(2,GL_FLOAT,sizeof(float)*4,(void *)&coords[2]);
@flagoworld
flagoworld / script.php
Created September 2, 2012 20:33 — forked from anonymous/Litle Script
Php Code
<?php
include_once "simple_html_dom.php";
set_time_limit(0);
try
{
$bdd = new PDO('mysql:host=localhost;dbname=facematch', 'root', ''); // Connection à la base de données
}
while(running)
{
glClear(GL_COLOR_BUFFER_BIT);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0,1024,768,0,-1.0,1.0);
glMatrixMode(GL_MODELVIEW);
while(running)
{
glClear(GL_COLOR_BUFFER_BIT);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0,1024,0.0,768,-1.0,1.0);
glMatrixMode(GL_MODELVIEW);
<?php
function foo($ob)
{
++$ob;
}
$bar=0;
foo($bar);
echo $bar; //echoes 0