Skip to content

Instantly share code, notes, and snippets.

View Anahkiasen's full-sized avatar

Emma Fabre Anahkiasen

View GitHub Profile
/**
* Transform a Query object to its SQL value
*
* @param Query $query
*
* @return string
*/
function queryToSql($query)
{
// Unnest query objects
@Anahkiasen
Anahkiasen / SassMeister-input-HTML.html
Created May 19, 2014 09:06
Generated by SassMeister.com.
<main>
<div class="third"></div>
<div class="third"></div>
<div class="third"></div>
</main>
@Anahkiasen
Anahkiasen / SassMeister-input-HTML.jade
Created May 16, 2014 17:18
Generated by SassMeister.com.
main
.third
.third
.third
.half
.half
angular.module('nobrow.interceptors').config(function ($provide, $httpProvider) {
$provide.factory('TokenHttpInterceptor',function ($http, $cacheFactory) {
var cache = $cacheFactory('nobrow');
return {
request: function (config) {
var token = cache.get('access_token');
if (token) {
config.headers.common.Authorization = 'Bearer '+token;
@Anahkiasen
Anahkiasen / SassMeister-input.scss
Created February 7, 2014 11:58
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
@import "compass";
$debug-browser-support: true;
body {
@include box-sizing(border-box);
@Anahkiasen
Anahkiasen / Curl.php
Last active April 7, 2025 10:22
curl
<?php
/**
* Object-oriented wrapper for CURL
*/
class Curl
{
/**
* The internal CURL instance
*
* @var resource
<?php
// Les instances en temps normal
//////////////////////////////////////////////////////////////////////
// En PHP, quand on a une classe non-statique, il faut d'abord l'instancier
// en faisant `new MyClass`. On place cette instance dans une variable, ensuite
// on appelle les méthodes sur la variables, comme ceci :
$elastica = new Elastica\Client('123456789');
<?php
// Si on passe les dépendances manuellement
class HTML
{
function __construct(URL $url)
{
$this->url = $url;
}
@Anahkiasen
Anahkiasen / fever.opml
Last active December 19, 2015 21:28
My Fever subscriptions
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<!-- OPML generated by Fever -->
<head><title>Fever</title></head>
<body>
<outline text="Kindling">
<outline type="rss" text=".chez kek." title=".chez kek." xmlUrl="http://blog.zanorg.com/rss/fil_rss.xml" htmlUrl="http://blog.zanorg.com/"/>
<outline type="rss" text=".net" title=".net" xmlUrl="http://feeds.feedburner.com/net/topstories" htmlUrl="http://www.netmagazine.com"/>
<outline type="rss" text="// hicksdesign - journal" title="// hicksdesign - journal" xmlUrl="http://hicksdesign.co.uk/feeds/rss/" htmlUrl="http://hicksdesign.co.uk/journal/"/>
<outline type="rss" text="24 ways" title="24 ways" xmlUrl="http://feeds.feedburner.com/24ways" htmlUrl="http://24ways.org/"/>
@Anahkiasen
Anahkiasen / separated.php
Last active December 17, 2015 12:59
To API or not to API
<?php
//////////////////////////////////////////////////////////////////////
//////////////////////// METHODOLOGIE SEPARÉE ////////////////////////
//////////////////////////////////////////////////////////////////////
// app/controllers/UsersController --------------------------------- /
class UsersController
{