Skip to content

Instantly share code, notes, and snippets.

@ipefixe
ipefixe / redshift.conf
Last active August 29, 2015 13:57
Paramètres "allégés" pour redshift
; Créer le fichier de conf : ~/.config/redshift.conf avec ce contenu :
[redshift]
temp-day=5700
temp-night=4000
transition=1
brightness-day=0.9
brightness-night=0.6
@ipefixe
ipefixe / p2013_exo2.pro
Last active August 29, 2015 14:16
p2013_exo2.pro
/* -*- Mode:Prolog; coding:UTF-8; -*- */
depart(P) :-
P = [v, v, v, v, p, v, v, v, p, p, p, v, v, v, v, v, p, v, v, v, v, v, v, p, v, v, v, v, v, v, v, v, v].
arrivee(P) :-
P = [v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, p, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v].
conversionLCN(Ligne, Col, Num) :-
Ligne >= 0,
@ipefixe
ipefixe / Main.java
Last active March 29, 2017 20:32
Show a spin in java
import javax.swing.*;
import java.awt.*;
public class Main extends JFrame {
private JLabel label = new JLabel();
public Main() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(new Dimension(80, 100));
@ipefixe
ipefixe / linux-say.sh
Last active March 29, 2017 20:34
Copying the behavior of the "SAY" command of Mac
#!/bin/bash
function say { # Similar to the cli say on Mac
pico2wave -l fr-FR -w speech.wav "$@"
play speech.wav &> /dev/null
rm speech.wav
}
alias clock='say "Il est $(date +%H) heure $(date +%M)"'
@ipefixe
ipefixe / DeluxeButtonPlayground.swift
Created August 11, 2017 11:38
Tuto raywenderlich
import PlaygroundSupport
import UIKit
final class DeluxeButton: UIView {
fileprivate let imageView: UIImageView = {
let imageView = UIImageView()
imageView.contentMode = .scaleAspectFit
return imageView
}()
import UIKit
@IBDesignable
public final class DeluxeButton: UIControl {
//MARK: public
@IBInspectable
public var pressedBackgroundColor: UIColor = #colorLiteral(red: 0.8725044748, green: 0.1784299846, blue: 0.06712985019, alpha: 1)
@IBInspectable
public var unpressedBackgroundColor: UIColor = #colorLiteral(red: 0.2392156869, green: 0.6745098233, blue: 0.9686274529, alpha: 1) {