Skip to content

Instantly share code, notes, and snippets.

View zurfyx's full-sized avatar

Gerard Rovira zurfyx

View GitHub Profile
@zurfyx
zurfyx / App.jsx
Created December 31, 2017 20:21
GDAX-like table effect
<div className="table">
<div className="row table-header">
<div>Timestamp</div>
<div>Temperature</div>
<div>Distance</div>
</div>
{this.state.data.map((entry, i) => (
<div key={entry.timestamp} className={
`row
${i === this.state.data.length - 1 ? 'last' : '' }
# Tag last commit as 'latest'.
if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
git config --global user.email "hi@travis-ci.org"
git config --global user.name "Sr. Travis"
git remote add release "https://${GH_TOKEN}@github.com/zurfyx/travis-android.git"
git push -d release latest
git tag -d latest
sudo: required
language: android
jdk: oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
cache:
sudo: required
language: android
jdk: oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
cache:
@zurfyx
zurfyx / RAM-SSD-HDD.md
Last active March 25, 2017 16:58
RAM vs. SSD vs. HDD
ls -lh | grep x.zip
-rwxrwxrwx 1 zurfyx zurfyx 2.9G Mar 25 17:39 x.zip
time cp x.zip y.zip
@zurfyx
zurfyx / index.html
Created March 10, 2017 21:28
cache selector (with & w/o jQuery) (http://jsbench.github.io/#3621d3b9b571cc3640fa988b42c5c873) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>cache selector (with & w/o jQuery)</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>map vs filter arr</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@zurfyx
zurfyx / server.js
Created November 15, 2016 19:25
Express, Socket.io, Passport & Redis.
import http from 'http';
import express from 'express';
import bodyParser from 'body-parser';
import cookieParser from 'cookie-parser';
import expressValidator from 'express-validator';
import Session from 'express-session';
import morgan from 'morgan';
import mongoose from 'mongoose';
import passport from 'passport';
import { createClient as createRedisClient } from 'redis';
<html>
<body>
<div typeof="schema:VideoObject">
<meta property="schema:videoQuality" content="low">
<span property="schema:actor" typeof="schema:Person">
<link property="schema:url" href="http://www.example.com">
</span>
<h1 property="schema:name">Title</h1>
<span property="schema:description">Description</span>
@zurfyx
zurfyx / hearthpwn-pack-opener.js
Created April 28, 2016 15:26
Hearthpwn pack-opener
(function($) {
function CardOpener(url, craft_cost, pack_title) {
this.url = url || 'http://www.hearthpwn.com/packs/simulator/4-all-golden-old-gods-pack';
this.craft_cost = craft_cost || 6000;
this.pack_title = pack_title || 'OMG THIS PACK';
};
CardOpener.prototype.open = function() {
var cards = $('.card-back');