Skip to content

Instantly share code, notes, and snippets.

Avatar
🏔️
YakShaving

Mattia Gheda ghedamat

🏔️
YakShaving
View GitHub Profile
View credit_courses_controller.rb
# frozen_string_literal: true
module ContinuingEducation
class CreditCoursesController < ApplicationController
rescue_from ActiveRecord::RecordNotFound do |_|
redirect_to 'https://precisionnutrition.com'
end
skip_authorization_check
View controllers.application\.js
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
View bullet.go
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)
View elixir-shell.nix
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
View shell-gigalixir.nix
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
Nix on MacOS catalina workaround
View workaround.sh
# 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 Jan 24, 2020 — forked from chris-martin/nixos-from-ubuntu.md
How to install NixOS from an Ubuntu liveCD
View nixos-from-ubuntu.md
View keybase.md

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:

View components.my-component.js
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);
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
value: 'valore'
});