Skip to content

Instantly share code, notes, and snippets.

@fridim
fridim / tarball.sh
Last active September 28, 2015 17:28
a small script to create archive (no option, can pass a file, a folder, a link ..)
#!/bin/sh
# Most of the time, you just want a .tar.gz of a folder, regardless of
# where you are. This is a small script that does it and put the result
# in /tmp. If you have xsel installed, it copied to your clipboard the
# destination file.
set -e
file="$1"
let g:netrw_preview=1
set relativenumber
set history=1000
set encoding=utf8
set laststatus=2
set shiftwidth=2
"au BufRead,BufNewFile *.rb,*.rhtml set shiftwidth=2
set softtabstop=2
set ts=2
"set guifont=Monospace\ 9

Keybase proof

I hereby claim:

  • I am fridim on github.
  • I am fridim (https://keybase.io/fridim) on keybase.
  • I have a public key whose fingerprint is 9E30 5E49 D4DE 5A7C FC0D F5D3 993E 1DC9 61F6 67C0

To claim this, I am signing this object:

@fridim
fridim / dmenu_screenshot_swift
Last active August 29, 2015 14:01
take a screenshot, upload it to openstack swift, and copy the link to the clipboard
#!/bin/sh
. ~/bin/dmenu_options
q="$(dmenu $options -l 60 -p "Screenshot :"|sed 's/ /_/g')"
[ "$q" ] || exit 1
mkdir -p ~/tmp
filename="$(date +%Y%m%d%H%M)_${q}.png"
import "${HOME}/tmp/${filename}"
. ~/PRIV/enocloud_fridim.rc
cd
swift upload public "tmp/$filename"
#!/bin/sh
p="$(sensors coretemp-isa-0000 | awk '/Physical/ { print $4 }')"
h="$(sensors coretemp-isa-0000 | awk '/Physical/ { print $7 }')"
echo "Temp: $p"
echo "T: $p"
if [[ $p > $h ]]; then
echo '#FFAAAA'
fi
[btc]
command=echo "BTC: $(curl 'https://blockchain.info/ticker' -s|jq '.["EUR"]["15m"]') €"
interval=600
@fridim
fridim / timezone.rb
Last active August 29, 2015 14:01 — forked from vivien/timezone.rb
Script to toggle timezones in i3blocks
#!/bin/ruby
#
# Toggle timezones in i3blocks
# Author: Vivien Didelot <vivien.didelot@gmail.com>
#
# Fill the ZONES array and define a block like this:
#
# [timezone]
# command=THIS_SCRIPT
# interval=5
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
require 'json'
require 'open-uri'
require 'uri'
require 'net/http'
CODE_LIMIT = 10
$url = "https://eval.in/"
$languages = {
#lang typed/racket/base
#| By replacing the 1st digit of the 2-digit number *3, it turns out that six of
the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime.
By replacing the 3rd and 4th digits of 56**3 with the same digit, this 5-digit
number is the first example having seven primes among the ten generated numbers,
yielding the family: 56003, 56113, 56333, 56443, 56663, 56773, and 56993.
Consequently 56003, being the first member of this family, is the smallest prime
with this property.
@fridim
fridim / euler60.md
Created November 26, 2014 19:53
Problème Euler 60 en Racket

Problème Euler 60

2014-11-26 #projecteuler #racketlang

L'énoncé sur projecteuler.net

la citation

If you can't explain it simply, you don't understand it well enough.
Albert Einstein