Skip to content

Instantly share code, notes, and snippets.

View danielres's full-sized avatar

Daniel Reszka danielres

View GitHub Profile
@danielres
danielres / trapped_lasers_disco.ino
Created November 10, 2017 12:52
trapped lasers disco with distance sensor
#include <Servo.h>
Servo myservo;
// servo & lasers
float pos = 0;
#define LA1 10
#define LA2 11
float minDeg = 80;
fallocate -l 1G /swapfile && \
chmod 600 /swapfile && \
mkswap /swapfile && \
sudo swapon /swapfile && \
swapon --show
@danielres
danielres / facebook.rb
Created December 11, 2015 17:49 — forked from a14m/facebook.rb
Gist for manually OAuth2 facebook for Rails APIs
# lib/omniauth/facebook.rb
require 'httparty'
module Omniauth
class Facebook
include HTTParty
# The base uri for facebook graph API
base_uri 'https://graph.facebook.com/v2.3'
@danielres
danielres / mindmap2html.xslt
Created April 10, 2015 11:03
XSLT to transform freeplane mindmaps (.mm) to pretty html files
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ex="http://exslt.org/dates-and-times"
extension-element-prefixes="ex">
<xsl:output
method="xml"
@danielres
danielres / es.sh
Last active December 15, 2015 01:49 — forked from sgringwe/es.sh
#cd ~
#sudo apt-get update
#sudo apt-get install openjdk-7-jre-headless -y
# Download the compiled elasticsearch rather than the source.
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
// ==UserScript==
// @name capybara serving assets
// @namespace http://studio.pixarea.com
// @description adds base tag to serve assets in pages generated by capybara's "save_and_open_page"
// @include file:///*/tmp/capybara/capybara-*.html
// @version 1
// @grant none
// ==/UserScript==
@danielres
danielres / watchr.rb
Last active December 12, 2015 03:38 — forked from mattsmith/watchr.rb
ENV["WATCHR"] = "1"
system 'clear'
puts 'watching ...'
def notify(message)
title = "Watchr Test Results"
message.gsub!("No DRb server is running. Running in local process instead ...", "")
puts message
is_passing = message.match(/\s0\s(errors|failures)/) ? true : false
@danielres
danielres / README.markdown
Created July 22, 2012 00:19
Using Font Awesome with Octopress
  1. Download Font Awesome (source)
  2. Take the file sass/font-awesome.sass and put it in your octopress sass folder
  3. Rename it to _font-awesome.sass
  4. Create a directory 'octpress/source/fonts' and put there the 4 font files (ttf, svg, eot and woff).
  5. In your stylesheet:
  • $fontAwesomePath: "fontawesome-webfont"
  • @import font-awesome

Done !

@danielres
danielres / 2012-07-21-post-with-images-from-flickr.markdown_
Created July 21, 2012 16:02
Fetching images from Flickr to show them in Octopress
---
layout: post
title: "Post with images from Flickr"
date: 2012-07-19 15:19
comments: true
categories: art
---
A big image:
@danielres
danielres / tarbackup.sh
Created July 14, 2012 00:31
backup script for my ALLDOC folder
#!/bin/sh
TODAY=`date --rfc-3339=date`
# TARBACKUP ALL EXCEPT DIR "GRAPHISME" ----------------------------------------
SOURCE="/media/files/ALLDOC/DANIEL"
EXCEPT="GRAPHISME"
TARGET="$TODAY"
mkdir -p "$TARGET"