Skip to content

Instantly share code, notes, and snippets.

View theely's full-sized avatar

Elia Palme theely

  • Switzerland
View GitHub Profile
@theely
theely / Dockerfile - dynamic crawling proof of concept
Last active June 20, 2016 06:58
Docker dynamic crawling proof of concept
FROM centos:centos7.2.1511
#Install Google Chrome, Java 8, Xvfb and unzip
#---------------------------------------------
RUN echo -e "[google-chrome]\n\
name=google-chrome\n\
baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub" > /etc/yum.repos.d/google-chrome.repo
module.exports = function(kibana) {
return new kibana.Plugin(
{
//plugin code
});
};
{
"name": "raw-data-table-preview",
"version": "0.0.1"
}
@theely
theely / sticky-section
Last active September 13, 2017 19:23
A angular2 component skeleton to implement a section sticky header
import {Component, OnInit, ElementRef, Output, EventEmitter, HostListener,Input,Output } from '@angular/core';
@Component({
selector: 'section',
templateUrl: './section.component.html',
styleUrls: ['./section.component.css']
})
export class SectionComponent implements OnInit {
@theely
theely / sticky-container
Last active October 13, 2017 05:42
sticky-header-container
import { Component, OnInit, Input,OnChanges, ElementRef,HostListener } from '@angular/core';
import {SectionComponent} from '../section/section.component';
@Component({
selector: 'container',
templateUrl: './container.component.html',
styleUrls: ['./container.component.css']
})
export class ContainerComponent implements OnInit {
@theely
theely / container-css
Last active September 13, 2017 19:24
sticky-html
.header{
position: fixed;
top: 0px;
width: inherit;
z-index: 2;
background: #252830;
}
@theely
theely / 01_switch_configuration.js
Created January 31, 2018 14:08
A cordova hook script
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var rootdir = process.argv[2];
function replace_string_in_file(filename, to_replace, replace_with) {
var data = fs.readFileSync(filename, 'utf8');
@theely
theely / GPSLog.lua
Created November 2, 2019 22:39
Rolling GPS latlong logging
-- Rolling GPS latlong logging
-- Stores the latest 100 distinct latlong coordinates (redundant coordinates are ignored).
-- If the number of sats is smaller than 4 coordinates are not recorded.
-- requires GPS telemetry
local function rnd(v,d)
if d then
return math.floor((v*10^d)+0.5)/(10^d)
else
@theely
theely / GPSLog.lua
Last active February 14, 2021 13:20
Rolling GPS latlong logging. Stores the latest 100 distinct latlong coordinates (redundant coordinates are ignored). Coordinates are stored in: /LOGS/GPS_rolling_positions.log. Logging is paused if less than 4 satellites are available.
-- License https://www.gnu.org/licenses/gpl-3.0.en.html
-- OpenTX Lua script
-- FUNCTION
-- Place this file in SD Card > /SCRIPTS/FUNCTIONS/
-- Author: Elia P.
-- Date: 2019 November 02
-- Description
@theely
theely / Ender-3 End G-code
Last active September 7, 2021 05:43
Ender-3 Start & End G-codes
G91 ; Relative positioning
G1 E-5 F3000 ; Retract a bit
G1 E-10 X5 Y5 Z5 F3000 ; Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positionning
G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed