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
package ejercicios;
import java.util.ArrayList;
import java.util.Random;
import java.util.Arrays;
public class Conjuntos{
private static ArrayList<String> union(ArrayList<String> primero, ArrayList<String> segundo){
ArrayList<String> retVal = new ArrayList<String>(primero);
for(String worte: segundo){
if(!primero.contains(worte))
@edysegura
edysegura / html5-validation-message.js
Last active April 28, 2023 06:22
How to prevent the browser from showing default HTML5 validation error message bubble?
document.addEventListener('invalid', (function(){
return function(e) {
//prevent the browser from showing default error bubble / hint
e.preventDefault();
// optionally fire off some custom validation handler
// myValidation();
};
})(), true);
@yamionp
yamionp / locustfile.py
Last active March 21, 2024 22:56
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
@adamrecsko
adamrecsko / highlight.pipe.ts
Created May 1, 2016 20:28
Angular2 text highlight pipe
import {PipeTransform, Pipe} from 'angular2/core';
@Pipe({ name: 'highlight' })
export class HighLightPipe implements PipeTransform {
transform(text: string, [search]): string {
return search ? text.replace(new RegExp(search, 'i'), `<span class="highlight">${search}</span>`) : text;
}
}
/** Usage:
*.tmp
# Word temporary
~$*.doc*
# Excel temporary
~$*.xls*
# Excel Backup File
*.xlk
@reallistic
reallistic / locustfile.py
Created June 12, 2016 22:31
Websocket client for locust.io (SockJS)
import time
import json
import gevent
from uuid import uuid4
from locust import HttpLocust, TaskSet, task, ResponseError, events, Locust
import websocket
class SocketClient(object):
@thesandlord
thesandlord / Dockerfile
Last active April 17, 2021 23:18
ConfigMaps and Secrets with Kubernetes
# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
FROM node:6-onbuild
EXPOSE 3000
ENV LANGUAGE English
ENV API_KEY 123-456-789
@adamar
adamar / client.py
Created April 6, 2017 06:37
Simple Websocket Client & Server Example (Python)
import websocket
import thread
import time
import sys
port = sys.argv[1]
def on_message(ws, message):
@tsabirgaliev
tsabirgaliev / Build lazy module
Last active January 4, 2019 01:40
Angular example plugin architecture
> tsc --lib es2016,dom --experimentalDecorators true --emitDecoratorMetadata true lazy.module.ts
@danielflower
danielflower / FileWatcher.java
Created April 22, 2017 08:54
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;