Skip to content

Instantly share code, notes, and snippets.

View aomnes's full-sized avatar

Antoine OMNES aomnes

View GitHub Profile
@aomnes
aomnes / secret_key_base
Created September 25, 2016 11:17 — forked from pablosalgadom/secret_key_base
app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)
So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message:
"app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)"
After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this:
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
besoin : "recuperer la liste des devises étrangeres"
getListForeignDevise() {
getListDevise(['EUR'])
}
assert getListForeignDevise() == ['YEN', 'USD']
En tant q'utilisateur
@aomnes
aomnes / MainThread.java
Created June 5, 2017 14:40
Thread return idée
package view.form;
/**
* Created by antoineomnes on 05/06/2017.
*/
class MainThread {
public void startMyThread() {
Object requiredObject = new Object(); //Map/List/OwnClass
Thread myThread = new Thread(new RunnableObject(requiredObject)).start();
myThread.join();
package view.thread;
import javax.swing.JOptionPane;
import controler.G_Joueur;
import view.form.Fenetre;
import view.form.FenetreJeu;
import javax.swing.*;
public class VerifGagnant extends JFrame implements Runnable {
@aomnes
aomnes / process.java
Created June 11, 2017 13:39
Exemple processus java
public void actionPerformed(ActionEvent arg0) {
ZDialog zd = new ZDialog(null, "General.io", true);
System.out.print(ZDialog.nb_ouverture);
nb_partie = ZDialog.nb_ouverture;
nom_a = zd.get_nom_r();
nom_b = zd.get_nom_b();
actualiser_param();
ZDialogInfo zInfo = zd.showZDialog();
JOptionPane jop = new JOptionPane();
jop.showMessageDialog(null, zInfo.toString(), "Data Game", JOptionPane.INFORMATION_MESSAGE);
@aomnes
aomnes / solution.go
Last active June 21, 2017 10:33
Test Stage
package main
import "fmt"
func main() {
var count int = 0
s := make([]bool, 120)
for i := 1; i <= 120; i++ {
for j := 0; j < 120; j += i {
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.1", arch: "x86_64", family: "mac"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: javax.enterprise.util.* < plexus.core
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T : Singleton<T>
{
protected static T instance;
/**
Returns the instance of this singleton.
*/
public static T Instance
using System.Linq;
using UnityEngine;
public class AutoReferencer<T> : MonoBehaviour where T : AutoReferencer<T> {
#if UNITY_EDITOR
// This method is called once when we add component do game object
protected new virtual void Reset()
{
// Magic of reflection