Skip to content

Instantly share code, notes, and snippets.

View ghedamat's full-sized avatar
🏔️
YakShaving

Mattia Gheda ghedamat

🏔️
YakShaving
View GitHub Profile
# frozen_string_literal: true
module ContinuingEducation
class CreditCoursesController < ApplicationController
rescue_from ActiveRecord::RecordNotFound do |_|
redirect_to 'https://precisionnutrition.com'
end
skip_authorization_check
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)
with import <nixpkgs> {};
let
my-python-packages = python-packages: with python-packages; [
pip
setuptools
];
python-with-my-packages = pkgs.python3.withPackages my-python-packages;
# define packages to install with special handling for OSX
with (import (builtins.fetchTarball {
name = "nixos-20.03-2020-05-27"; # Descriptive name
url =
"https://github.com/nixos/nixpkgs-channels/archive/48723f48ab92381f0afd50143f38e45cf3080405.tar.gz";
sha256 = "0h3b3l867j3ybdgimfn76lw7w6yjhszd5x02pq5827l659ihcf53";
}) { });
let
pkgs = import (builtins.fetchTarball {
name = "nixos-20.03-2020-05-27"; # Descriptive name
url =
@ghedamat
ghedamat / workaround.sh
Created May 17, 2020 14:05
Nix on MacOS catalina workaround
# taken from https://github.com/NixOS/nix/issues/2925#issuecomment-539570232
#1. Check if /nix exists.
# If not, run
echo 'nix' | sudo tee -a /etc/synthetic.conf
#then reboot.
@ghedamat
ghedamat / nixos-from-ubuntu.md
Last active April 28, 2023 16:32 — forked from chris-martin/nixos-from-ubuntu.md
How to install NixOS from an Ubuntu liveCD

Keybase proof

I hereby claim:

  • I am ghedamat on github.
  • I am ghedamat (https://keybase.io/ghedamat) on keybase.
  • I have a public key whose fingerprint is 8771 BF7F 0FEE 3724 2FE4 9274 8B8F 0DD6 349B B04B

To claim this, I am signing this object:

import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement: function() {
let _this = this;
window.fetch('https://cors-test.appspot.com/test').then(function(data) {
data.json().then(function(v) {
console.log(v);
_this.set('content', v.status);
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
value: 'valore'
});