Skip to content

Instantly share code, notes, and snippets.

View kdridi's full-sized avatar
🙃
Focusing

Karim DRIDI kdridi

🙃
Focusing
  • Ubisoft
  • Montpellier, FRANCE
  • X @kdridi
View GitHub Profile
#include "sample_window.h"
#include <stdlib.h>
#include <SFML/Graphics/RenderWindow.h>
#include <SFML/Graphics/Sprite.h>
#include <SFML/Graphics/Texture.h>
#include <SFML/Window/VideoMode.h>
#include <SFML/Window/Event.h>
import React from 'react';
import Relay from 'react-relay';
class App extends React.Component {
render() {
return (
<div>
<h1>Widget list</h1>
<ul>
{this.props.viewer.widgets.edges.map(edge =>
import React, { Component } from 'react';
import Relay from 'react-relay';
const Widget = ({ widget: { id, name } }) => <li>
{name} !! (ID: {id})
</li>;
class WidgetList extends Component {
render() {
console.log('rendering WidgetList');
@kdridi
kdridi / gist:5231661
Created March 24, 2013 12:13
I didn't get why getRSS returns an empty array
{-# LANGUAGE Arrows, NoMonomorphismRestriction #-}
module Main where
import Text.XML.HXT.Core
import Network.HTTP
get x = getResponseBody =<< simpleHTTP (getRequest x)
parseXML doc = readString
class ApplicationController < ActionController::Base
protect_from_forgery
after_filter :set_access_control_headers
def set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Request-Method'] = '*'
end
end
@kdridi
kdridi / index.html
Created October 24, 2012 04:44 — forked from rfessler/index.html
A CodePen by rfessler.
<!DOCTYPE html>
<html >
<head>
<title>Display Data Using jQuery</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8">0
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="application.js" type="text/javascript" charset="utf-8"></script>
</head>
Resolving dependencies...
[1 of 1] Compiling Main ( /var/folders/x6/hd161g356mbc8hmmzsj4xdy40000gn/T/haskelldb-hsql-0.10-49689/haskelldb-hsql-0.10/Setup.hs, /var/folders/x6/hd161g356mbc8hmmzsj4xdy40000gn/T/haskelldb-hsql-0.10-49689/haskelldb-hsql-0.10/dist/setup/Main.o )
Linking /var/folders/x6/hd161g356mbc8hmmzsj4xdy40000gn/T/haskelldb-hsql-0.10-49689/haskelldb-hsql-0.10/dist/setup/setup ...
Configuring haskelldb-hsql-0.10...
Warning: No 'build-type' specified. If you do not need a custom Setup.hs or
./configure script then use 'build-type: Simple'.
Building haskelldb-hsql-0.10...
Preprocessing library haskelldb-hsql-0.10...
Database/HaskellDB/HSQL.hs:1:1:
max' = f
where f x y = if x > y then x else y
import System.IO
read_lines :: Handle -> IO [String]
read_lines h = hIsEOF h >>= \eof ->
if eof then
return []
else
hGetLine h >>= \line ->
return (line:[])
(** Login information for a database. database. Use [None] for default values *)
type db = { dbhost : string option; (** database server host *)
dbname : string option; (** database name *)
dbport : int option; (** port *)
dbpwd : string option; (** user password *)
dbuser : string option; (** database user *)
}