Skip to content

Instantly share code, notes, and snippets.

View atomsfat's full-sized avatar
🏠
Working from home

Tomás atomsfat

🏠
Working from home
View GitHub Profile
<scheme name="Darcula sarayi" version="142" parent_scheme="Darcula">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2020-06-24T10:10:21</property>
<property name="ide">idea</property>
<property name="ideVersion">2019.3.0.0</property>
<property name="modified">2020-06-24T10:10:28</property>
<property name="originalScheme">Darcula sarayi</property>
</metaInfo>
<option name="LINE_SPACING" value="1.0" />
@atomsfat
atomsfat / Makefile
Last active February 12, 2020 04:13
Makefile to generate api-clients
# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
.DEFAULT_GOAL := client-generated
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
ONLINE_GEN_URL=https://generator3.swagger.io/api/generate
# client specific
LANG:=javascript
CODE_GEN_VERSION=V3
API_DOC_URL:=http://localhost:8000/openapi.json
@atomsfat
atomsfat / fillform.js
Created April 24, 2017 18:12
fillcustomsform
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdn.rawgit.com/Marak/faker.js/master/examples/browser/js/faker.js';
script.onload = function() {
console.log("------>", faker, $("input[name='email']"))
window.randomData = function() {
// console.log("random data");
faker.locale = 'es_MX';
@atomsfat
atomsfat / simpleserver.js
Created November 22, 2016 19:01
Simple sever to debug header and url behind proxies
var express = require('express');
var app = express();
app.get('/*', function (req, res) {
console.log(req.originalUrl)
console.log(req.headers)
res.send('Hello World!');
});
app.listen(8090, function () {
#!/bin/bash
CURL_FORMAT="URL: %{url_effective} ReturnCode: %{http_code}, TTFB: %{time_starttransfer}, Total time: %{time_total}, Download Size: %{size_download}"
FILE_URL=$1
TOTAL_URL=$(wc -l < $FILE_URL | xargs)
COUNTER=1
echo "1..$TOTAL_URL"
while read LINE
do
RES=$(curl -L -s -o /dev/null -w "$CURL_FORMAT" $LINE)
@atomsfat
atomsfat / varnish.vcl
Created August 30, 2016 21:39
Mobile Device Detection via User Agent RegEx Varnish
#Mobile detect https://gist.github.com/dalethedeveloper/1503252
if(req.http.User-Agent ~ ".*(Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune).*")
{
set req.http.X-ua = "mobile";
}else{
set req.http.X-ua = "desktop";
}
sub vcl_hash {
hash_data(req.http.X-ua + ":" + req.url );
@atomsfat
atomsfat / gist:dc2ede8cbea2f397cd7f
Created February 25, 2015 18:33
raml2code build
#!/bin/bash
git@github.com:gextech/json-schema-2-groovy-pojo.git
git@github.com:gextech/json-schema-java-mapper-utils.git
git@github.com:atomsfat/raml2code.git
git@github.com:atomsfat/raml2code-fixtures.git
git@github.com:gextech/raml2code-jaxrs-interfaces.git
git@github.com:gextech/raml2code-retrofit.git
git@github.com:gextech/ram2code-utils.git
@atomsfat
atomsfat / docker_acordeon.txt
Created November 5, 2014 17:34
docker acordeon
boot2docker ip →Get lP
docker info
docker rm <name>
docker stop <name>
docker start <name>
docker attach <name>
docker ps -a
docker logs -f <name>
docker top <name>
docker inspect <name>
@atomsfat
atomsfat / Ingreso Proyecto
Last active August 29, 2015 14:08
Proyecto GEX Developer SR
Construir una api REST, para hacer altas, bajas cambios de usuarios, documentar la API.
Utilizar las siguientes tecnologias.
* Spring Boot
* PostgreSQL hibernate o Gorm
* Gradle
@atomsfat
atomsfat / concurrent
Created April 21, 2014 21:16
concurrent closuere
def concurrent(int count, Closure closure) {
def values = []
def futures = []
ExecutorService executor = Executors.newFixedThreadPool(count)
CyclicBarrier barrier = new CyclicBarrier(count)
for (int i = 0; i < count; i++) {
futures.add(executor.submit(new Callable() {
public def call() throws Exception {