Skip to content

Instantly share code, notes, and snippets.

View amine2233's full-sized avatar

Amine Bensalah amine2233

View GitHub Profile
@janikvonrotz
janikvonrotz / Convert SSL certificates.md
Created March 7, 2014 15:12
Ubuntu: Convert SSL certificates #OpenSSL #Markdown

Requirements

  • Get a free verified SSL certificate from StartSSL (optional)

Instructions

When buying a certificate from you CA (Certification Authority) e.g. a wildcard certificate for *.example.org, you have to convert this file to different formats in order to use them with your webserver installation.

To convert these files use OpenSSL.

public function autocomplete() {
$this->request->params['named']['filter'] = $this->request->data[$this->modelClass]['filter'];
if (!empty($this->request->params['named']['filter']) || $this->request->params['named']['filter'] !== '') {
$this->Prg->commonProcess();
$this->Paginator->settings = array(
'conditions' => $this->Location->parseCriteria($this->Prg->parsedParams()),
);
$this->set('locations', $this->Paginator->paginate());
}
$this->render('autocomplete', 'ajax');
@xpepper
xpepper / Some tools and tweaks on Mac OS X.md
Last active May 6, 2025 14:52 — forked from g3d/gist:2709563
Some tools and tweaks on Mac OS X
@staltz
staltz / introrx.md
Last active May 15, 2025 10:37
The introduction to Reactive Programming you've been missing
@seyhunak
seyhunak / request.swift
Last active February 4, 2020 06:14
NSURLRequest in Swift
import Foundation
class Request : NSObject {
var url : NSURL? = nil
var request : NSMutableURLRequest? = nil
var response : NSHTTPURLResponse? = nil
var data: NSMutableData? = nil
var done: (NSError?, NSData, NSString?) -> () = { (_, _, _) -> () in }
@kristopherjohnson
kristopherjohnson / unzip.swift
Last active December 10, 2022 14:21
zip(), zip3(), unzip(), and unzip3() for Swift
// Given array of 2-tuples, return two arrays
func unzip<T, U>(array: [(T, U)]) -> ([T], [U]) {
var t = Array<T>()
var u = Array<U>()
for (a, b) in array {
t.append(a)
u.append(b)
}
return (t, u)
}
@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

//
// StoreKitExampleViewController.swift
// StoreKitTest
//
// Created by Atsushi Nagase on 10/2/14.
// Copyright (c) 2014 Atsushi Nagase. All rights reserved.
//
import UIKit
import StoreKit
@justinmakaila
justinmakaila / APIRoute.swift
Created February 6, 2015 16:32
Alamofire API Route Protocol
/**
An API Route
*/
protocol APIRoute {
var method: Alamofire.Method { get }
var encoding: Alamofire.ParameterEncoding { get }
var path: String { get }
var parameters: [String: AnyObject]? { get }
var requestConvertible: APIRequestConvertible { get }
}
@topheman
topheman / .vimrc
Last active February 17, 2025 16:59
vim-config on Mac OS X
" Vundle config
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')