Skip to content

Instantly share code, notes, and snippets.

@houssemFat
houssemFat / tips.md
Created December 23, 2016 09:12
Git issues

You have not concluded your merge (MERGE_HEAD exists)

Source

Error when pulling with You have not concluded your merge (MERGE_HEAD exists)

git merge --abort reolve confilcts git pull

get a clean copy of ressources

git merge --abort git pull -Xtheirs github master

<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.2.6/gridstack.min.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script type="text/javascript" src='https://cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.2.6/gridstack.min.js'></script>
<script src="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
</head>
@houssemFat
houssemFat / json.go
Last active November 21, 2016 16:08
Golang snippets
package main
import (
"encoding/json"
"fmt"
)
func main() {
s := `{"text":"I'm a text.","number":1234,"floats":[1.1,2.2,3.3],"innermap":{"foo":1,"bar":2}}`
@houssemFat
houssemFat / sort.js
Last active November 10, 2016 19:34
sorting algorithms
var a = [6, 5, 3, 1, 9, 7, 2, 4];
var length = a.length ;
bubbleSort = function (){
var swap = 0 ;
for (i = 0 ; i < length - i + 1 ; i++){
for (var j = 1 ; j < length - i ; j++) {
if (a[j-1] > a[j] ){
console.log ("moving " + a[j-1])
swap = a[j] ;
a[j] = a[j-1] ;
@houssemFat
houssemFat / mqtt-client.py
Last active November 10, 2016 19:33
how to run 6.4 mqtt client connection with mqq
import paho.mqtt.client as mqtt
from os import path
import json
BASE_URL = "" ;
CHANNEL_ALL = 'common'
CHANNEL_REPLY = 'reply'
CLIENT = '/me-it'
class Client:
def __init__(self, name, suffix =""):
@houssemFat
houssemFat / Dockerfile
Last active November 10, 2016 19:30
Ubuntu 14.04, nginx , passenger and http2
#TODO
@houssemFat
houssemFat / process.py
Created October 24, 2016 16:50
Image tools processing
from PIL import Image
from math import floor
from PIL import ImageFilter
def cin():
pil_im = Image.open('test.png')
width = pil_im.width
height = pil_im.height
@houssemFat
houssemFat / horizontal-infinite-carousel.html
Created October 11, 2016 19:53 — forked from dongyuwei/horizontal-infinite-carousel.html
infinite loop carousel(vertical or horizontal)
@houssemFat
houssemFat / nginxproxy.md
Created May 12, 2016 10:18 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@houssemFat
houssemFat / leaflet-custom-map.html
Created May 4, 2016 22:15 — forked from MarZab/leaflet-custom-map.html
Leaflet with latlng scale in meters and Control.Scale to match
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Custom Simple Map Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
<link rel="stylesheet" href="https://cdn.rawgit.com/ardhi/Leaflet.MousePosition/master/src/L.Control.MousePosition.css">