Skip to content

Instantly share code, notes, and snippets.

Tomas Salazar atomsfat

Block or report user

Report or block atomsfat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Arduino_telnet_Server.pde
/* *
* Arduino Telnet Server *
* 7 July 2010 *
* Basic Arduino I/O via *
* a command line interface *
* by Steve Lentz *
* stlentz[at]gmail[dot]com *
Quick Start Instructions:
1) Set Ethernet address in code below.
atomsfat / s3_up.groovy
Last active Jul 10, 2019
Upload to S3 with Groovy
View s3_up.groovy
/* Script to upload files to S3.
* @author Tomas Salazar
@GrabResolver(name='jets3t', root='', m2Compatible='true')
@Grab(group='', module='jets3t', version='0.9.0')
import org.jets3t.service.model.*
accessKey = 'Cambiar'
atomsfat / java_linux
Last active Jun 4, 2018
Java linux update-alternatives
View java_linux
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_25/bin/java" 2
sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_25/bin/java
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_25/bin/javac" 2
sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_25/bin/javac
sudo ln -s /opt/java/jdk1.7.0_25/jre/lib/i386/
sudo ln -s /opt/java/jdk1.7.0_25/jre/lib/amd64/
atomsfat / fillform.js
Created Apr 24, 2017
View fillform.js
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '';
script.onload = function() {
console.log("------>", faker, $("input[name='email']"))
window.randomData = function() {
// console.log("random data");
faker.locale = 'es_MX';
atomsfat / simpleserver.js
Created Nov 22, 2016
Simple sever to debug header and url behind proxies
View simpleserver.js
var express = require('express');
var app = express();
app.get('/*', function (req, res) {
res.send('Hello World!');
app.listen(8090, function () {
CURL_FORMAT="URL: %{url_effective} ReturnCode: %{http_code}, TTFB: %{time_starttransfer}, Total time: %{time_total}, Download Size: %{size_download}"
TOTAL_URL=$(wc -l < $FILE_URL | xargs)
echo "1..$TOTAL_URL"
while read LINE
RES=$(curl -L -s -o /dev/null -w "$CURL_FORMAT" $LINE)
atomsfat / varnish.vcl
Created Aug 30, 2016
Mobile Device Detection via User Agent RegEx Varnish
View varnish.vcl
#Mobile detect
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";
set req.http.X-ua = "desktop";
sub vcl_hash {
hash_data(req.http.X-ua + ":" + req.url );
atomsfat / BootStrap.groovy
Created Jan 28, 2014
BootStrap definition to automatically register custom marshaller
View BootStrap.groovy
class BootStrap {
def grailsApplication
//here we register custom marshallers declared in domain classes
atomsfat / Media.groovy
Created Jan 28, 2014
Fat grails domain class with custom marshaller
View Media.groovy
import grails.converters.JSON
import org.joda.time.DateTime
class Media implements Serializable {
String url
String name
DateTime dateCreated
atomsfat / 2roman.groovy
Created Dec 20, 2013
cardinal to roman
View 2roman.groovy
def cardinalToRoman( int num){
def TreeMap map = [1:"I", 5: "V", 10 : "X", 100 :"C"]
def getLatestKey = {int nu ->
def val = null
for (Map.Entry entry : map.descendingMap().entrySet()) {
def residuo = nu % entry.key;
You can’t perform that action at this time.