Skip to content

Instantly share code, notes, and snippets.

View Julianhm9612's full-sized avatar
💭
Make it happen!

Julian Henao Marin Julianhm9612

💭
Make it happen!
View GitHub Profile
@Julianhm9612
Julianhm9612 / FileWatcher.java
Created September 16, 2019 12:49 — forked from danielflower/FileWatcher.java
Watching a single file in java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.nio.file.*;
public class FileWatcher {
private static final Logger log = LoggerFactory.getLogger(FileWatcher.class);
private Thread thread;
*.tmp
# Word temporary
~$*.doc*
# Excel temporary
~$*.xls*
# Excel Backup File
*.xlk
@Julianhm9612
Julianhm9612 / client.py
Created June 25, 2019 14:25 — forked from adamar/client.py
Simple Websocket Client & Server Example (Python)
import websocket
import thread
import time
import sys
port = sys.argv[1]
def on_message(ws, message):
@Julianhm9612
Julianhm9612 / zen_python.md
Created April 29, 2019 18:55 — forked from pyjavo/zen_python.md
El zen de Python: Explicado y con ejemplos

El Zen de Python

Si alguna vez abren la consola de python y escriben import this verán que les aparecerán las líneas con el famoso Zen de Python:

  1. Beautiful is better than ugly.
  2. Explicit is better than implicit.
  3. Simple is better than complex.
  4. Complex is better than complicated.
  5. Flat is better than nested.
  6. Sparse is better than dense.
@Julianhm9612
Julianhm9612 / locustfile.py
Created November 26, 2018 16:59 — forked from yamionp/locustfile.py
Websocket Locust Sample. locustfile and Echo/Chat Server
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import json
import uuid
import time
import gevent
@Julianhm9612
Julianhm9612 / Function.Array-Group-By.php
Created June 22, 2018 20:16 — forked from mcaskill/Function.Array-Group-By.php
PHP : Groups an array by a given key
<?php
if (!function_exists('array_group_by')) {
/**
* Groups an array by a given key.
*
* Groups an array into arrays by a given key, or set of keys, shared between all array members.
*
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function.
* This variant allows $key to be closures.
@Julianhm9612
Julianhm9612 / JavaScript
Created May 16, 2018 22:48 — forked from hugeuser/JavaScript
"Scroll-Jacking" in Full Screen.
var delta;
var currentSlideIndex = 0;
function elementScroll (e) {
// --- Scrolling up ---
if (e.originalEvent.detail < 0 || e.originalEvent.wheelDelta > 0) {
delta--;
@Julianhm9612
Julianhm9612 / ng-update-v6.js
Created May 15, 2018 17:10 — forked from leo6104/ng-update-v6.js
Convert .angular-cli.json to angular.json (for Angular 6 Migration from Angular 2/4/5)
/**
* Created by leo6104 (github.com/leo6104)
* You can use this nodejs script on angular v5/v4/v2 project.
* 1. Place this gist file `ng-update-v6.js` to angular project's root path
* 2. use command `node ng-update-v6.js .angular-cli.json`
* 3. check angular.json file (created by ng-update-v6.js)
**/
const fs = require('fs');
const path = require('path');
@Julianhm9612
Julianhm9612 / openssl-example.php
Created February 27, 2018 15:01 — forked from viccherubini/openssl-example.php
OpenSSL PHP example
<?php
class protector {
private $passphrase = null;
private $private_key = null;
private $public_key = null;
public function __construct() {
@Julianhm9612
Julianhm9612 / mapOrder.js
Created February 9, 2018 16:15 — forked from ecarter/mapOrder.js
Order an array of objects based on another array order
/**
* Sort array of objects based on another array
*/
function mapOrder (array, order, key) {
array.sort( function (a, b) {
var A = a[key], B = b[key];