Skip to content

Instantly share code, notes, and snippets.

View myalban's full-sized avatar
🤠
Available

Alban DOUSSAU de GUYONNET myalban

🤠
Available
View GitHub Profile
package com.comalia.gesicamobile.util;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Looper;
import android.util.DisplayMetrics;
import android.util.TypedValue;
/**
* Equivalent to jquery.extend : copy non null properties from origin to dest if exist
*
* @param orig
* @param dest
*/
public static void extend( Object orig, Object dest )
{
if ( orig == null || dest == null )
{
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
var net = require('net');
var sockets = [];
var port = 8000;
var guestId = 0;
var server = net.createServer(function(socket) {
// Increment
guestId++;
socket.nickname = "Guest" + guestId;
@myalban
myalban / sips-atos-v2.php
Created July 25, 2016 08:49
Sips-ATOS v2 (BNP Paribas, mercanet)
<?php
$action = 'https://payment-webinit.simu.mercanet.bnpparibas.net/paymentInit';
//$action = 'https://payment-webinit.mercanet.bnpparibas.net/paymentInit';
$merchantId = '002001000000001';
$keyVersion = '1';
$secretKey = '002001000000001_KEY1';
$Data = 'amount=1000';
@myalban
myalban / async-script-loader.js
Created May 22, 2018 11:43 — forked from TexRx/async-script-loader.js
pure js async script loader
function loadScript(src, callback)
{
var s,
r,
t;
r = false;
s = document.createElement('script');
s.type = 'text/javascript';
s.src = src;
s.onload = s.onreadystatechange = function() {
@myalban
myalban / git develop to master
Created September 25, 2018 07:42 — forked from royrusso/git develop to master
Git: merge 'develop' in to 'master'
git checkout master
git merge develop
git push -u origin master
@myalban
myalban / download-file.js
Created February 7, 2019 23:09 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@myalban
myalban / capture.html
Created February 19, 2019 08:56 — forked from ajardin/capture.html
Capture a thumbnail from a video with JavaScript.
<!DOCTYPE html>
<head>
<script type='text/javascript'>
window.onload = function () {
var video = document.getElementById('videoId');
var canvas = document.getElementById('canvasId');
var img = document.getElementById('imgId');
video.addEventListener('play', function () {
canvas.style.display = 'none';
<?php
/*
Created by: [email protected] 16/03/2014
Name of script: Create WordPress Admin User
Description: This script will create an admin user in wordpress
Usage: Create a new file in the root of the hosting account and drop this code into it then execute the script through the browser.