Skip to content

Instantly share code, notes, and snippets.

View eyenx's full-sized avatar

Toni Tauro eyenx

View GitHub Profile
#!/usr/bin/python
import urllib.request as ur
import http.server as hs
import socketserver as ss
import os
indexfile="https://paste.eyenx.ch/index.php/W2AGE"
tmpdir="/tmp/schwaul/"
/* UserChrome CSS to revert Australis change
* taken from http://b.fluff.cc/2014/02/firefox-29-australis-aka-fuck-you.html
*/
/* tab separators */
.tabbrowser-tab:after, .tabbrowser-tab:before {
visibility: hidden !important;
}
/* tabbar background */
-- Transformer
-- Input Data: File with these example lines
-- 2014-08-11T23:45:01;1407793501;214821;214821
-- 2014-08-11T23:50:01;1407793801;214887;214887
-- 2014-08-11T23:55:01;1407794101;214955;214955
--
-- Ouput Data: Array of Tuples of (Time2,Diff1,Diff2),(Time3,Diff2,Diff3)
--
-- [(2014-08-11T23:50:01,300,66),(2014-08-11T23:55:01300,300,68)]
--
var app = angular.module('app',[]);
app.controller('mainc',function($scope,$http){
var aggr=0;
var lbltoggler=5;
$scope.times=[];
$scope.values=[];
$scope.metrics=[];
$http.get('data.csv').success(function(d){
$scope.data=d.split('\n');
@eyenx
eyenx / imp.hs
Last active December 20, 2015 00:38
--baby functions
doubleMe x = x + x
doubleUs x y = x * 2 + y * 2
doubleSmallNumber x = if x > 100 then x else x*2
-- list comprehensions
boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x ]
listcomprehend xs = [x+2 | x<-xs, x+2>12]
--length'
length' xs = sum [1 | _ <- xs]
--removeNonUppercase
@eyenx
eyenx / xmonad.hs
Last active December 20, 2015 00:39
-- gnomeye's xmonad.hs
-- imports
import XMonad
import System.IO (hPutStrLn)
import Data.Monoid
import Data.List
#!/usr/bin/perl
### ompldr upload script
use v5.14;
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
## def
my $url="http://ompldr.org/upload";
<?php
function curlit($url){
$get=curl_init("$url");
curl_setopt($get,CURLOPT_RETURNTRANSFER,1);
$resp=curl_exec($get);
curl_close($get);
return($resp);
}
function getrandwp(){
$url="http://wallbase.cc/random?section=wallpapers&q=&res_opt=eqeq&res=1920x1080&thpp=32&purity=100&board=21&aspect=0.00";
@eyenx
eyenx / wfica.sh
Last active December 25, 2015 12:59
#!/bin/sh
## workaround proxy error by kru
tmp=/tmp/$RANDOM
awk '{ gsub("ProxyType.*",""); print }' < $1 > $tmp
export ICAROOT=/usr/lib/ICAClient
${ICAROOT}/wfica -file $tmp
@eyenx
eyenx / prefs.js
Last active December 26, 2015 14:38
user_pref("browser.bookmarks.restore_default_bookmarks", false);
user_pref("browser.cache.disk.parent_directory", "~/.cache/firefox");
user_pref("browser.cache.memory.capacity", 1048576);
user_pref("browser.download.dir", "/tmp/dwn");
user_pref("browser.download.folderList", 2);
user_pref("browser.download.manager.showWhenStarting", false);
user_pref("browser.download.panel.firstSessionCompleted", true);
user_pref("browser.download.panel.shown", true);
user_pref("browser.download.save_converter_index", 0);
user_pref("browser.download.useToolkitUI", true);