Skip to content

Instantly share code, notes, and snippets.

View kidager's full-sized avatar
🎧
¯\_(ツ)_/¯

Jacem Chaieb kidager

🎧
¯\_(ツ)_/¯
View GitHub Profile
@kidager
kidager / xhr.promise.js
Last active August 29, 2015 14:18 — forked from matthewp/gist:3099268
Asynchronous request using promises
function xhr(options) {
var deferred = Q.defer(),
req = new XMLHttpRequest();
req.open(options.method || 'GET', options.url, true);
// Set request headers if provided.
Object.keys(options.headers || {}).forEach(function (key) {
req.setRequestHeader(key, options.headers[key]);
});
@kidager
kidager / codeigniter-apache-hhvm.md
Created February 1, 2016 15:46 — forked from shivaas/codeigniter-apache-hhvm.md
CodeIgniter with Apache & HHVM as FastCGI

Apache Configuration:

<VirtualHost *:80>
  ServerName blah.com

  DirectoryIndex index.html index.php
  ProxyRequests On
  ProxyPreserveHost On
  ProxyVia full
public class LoginObject {
String token;
User user;
// Getters w Setters (public elkol)
}
\documentclass[12pt, oneside, a4paper]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Include required packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage[skins]{tcolorbox}
\usepackage[francais,english]{babel}
\usepackage{ctable}
\usepackage{multirow}
@kidager
kidager / Package Control.sublime-settings
Created October 3, 2016 10:35
Sublime Text 3 Package Control
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"AdvancedNewFile",
"Alignment",
"Auto Close HTML Tags",
@kidager
kidager / filter-products.json
Last active March 17, 2017 11:50
Newlook responses
{
"totalRecords": 1092,
"items": [
{
"entity_id": "1",
"entity_type_id": "4",
"attribute_set_id": "4",
"type_id": "simple",
"sku": "4410601170",
"has_options": "0",
##crypto
##defocus
##javascript
##linux
##math
##networking
##php
##security
#android
#android-dev
@kidager
kidager / console.php
Created June 26, 2018 13:01
scrap scrap
<?php
// Some Artisan stuff
Artisan::command('do:shit', function () {
$guzzleClient = new GuzzleHttp\Client([
'base_uri' => 'https://www.seloger.com',
'headers' => [
'Connection' => 'keep-alive',
'Pragma' => 'no-cache',
<?php
$response = $guzzleClient->get(
// 'list.htm?tri=initial&idtypebien=2,1&div=2238&idtt=1&naturebien=1,2,4&LISTING-LISTpg=2'
'list.htm?tri=initial&idtypebien=2,1&div=2238&idtt=2,5&naturebien=1,2,4&LISTING-LISTpg=1'
// 'list.htm?tri=initial&idtypebien=1,2&cp=75&idtt=1&naturebien=1,2,4&bd=DetailToList_SL'
);
$html = (string)$response->getBody();
$internalErrors = libxml_use_internal_errors(true);
$dom = new DOMDocument('1.0', 'UTF-8');