Skip to content

Instantly share code, notes, and snippets.

View aalemayhu's full-sized avatar
💭
If at first the idea is not absurd, then there is no hope for it - Albert

Alexander Alemayhu aalemayhu

💭
If at first the idea is not absurd, then there is no hope for it - Albert
View GitHub Profile
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Test';
}
@aalemayhu
aalemayhu / emoji-encoding-reproducer-ruby.md
Created April 8, 2020 19:19
Encoding issue in Ruby head?

Hit tab after emoji in irb

➜ rvm use ruby-2.7.0-preview1
Using /Users/ccscanf/.rvm/gems/ruby-2.7.0-preview1
~ ➜ irb
2.7.0-preview1 :001 > “Hello World 🌍” Traceback (most recent call last):        30: from /Users/ccscanf/.rvm/rubies/ruby-2.7.0-preview1/bin/irb:23:in `<main>'
        29: from /Users/ccscanf/.rvm/rubies/ruby-2.7.0-preview1/bin/irb:23:in `load'        28: from /Users/ccscanf/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/irb-1.0.
0/exe/irb:11:in `<top (required)>'        27: from /Users/ccscanf/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/2.7.0/irb.rb:388:in `sta
rt'        26: from /Users/ccscanf/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/2.7.0/irb.rb:430:in `run
@aalemayhu
aalemayhu / 256-challenge.md
Last active April 11, 2020 05:47
256 Weekly challenge footer

I’m Alexander and work as a Web Developer at Scrimba - The mind blowing way to learn how to code. This post is a part of my personal weekly challenge of writing 256 words per week to improve my writing on technical topics.

I hope you found it useful. Thank you for reading.

@aalemayhu
aalemayhu / index.html
Created April 6, 2020 10:04
Simple Bulma HTML Page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello Bulma!</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<script defer src="https://use.fontawesome.com/releases/v5.0.7/js/all.js"></script>
</head>
<body>
@aalemayhu
aalemayhu / stack.md
Last active April 8, 2020 07:40
The Tools
let t =  ['Imba', 'vim', 'Bulma', 'Netlify', 'Paddle', 'Postico', 'Adobe XD', 'Convertkit']
console.log('# Preffered Tools', t.map(do |x| "0. {x}").join('\n'))
Description
Imba Programming language
Vim Text Editor
Bulma CSS Framework
# /usr/bin/notify-site-is-down.rb
require "rubygems"
require "twilio-ruby"
account_sid = ENV["TWILIO_ACCOUNT_SID"]
auth_token = ENV["TWILIO_AUTH_TOKEN"]
@client = Twilio::REST::Client.new account_sid, auth_token
@aalemayhu
aalemayhu / x.md
Created September 6, 2019 08:29
markdown test

single line snippet

@aalemayhu
aalemayhu / without-newline.imba
Created August 21, 2019 08:34
Log without a newline in Imba
# Inside of a script you can always do
process:stdout:write("Hei")
@aalemayhu
aalemayhu / install-requires.js
Created August 8, 2019 10:08
Install all of the requires from a Javascript file using yarn
const { execFile } = require('child_process');
const fs = require('fs');
fs.readFile('./input-file.js', (err, data) => {
if (err) throw err;
let payload = data.toString();
let lines = payload.split('\n').filter(x => x.includes('require'));
let requires = lines.map(x => x.split('require')[1]);
let modules = requires.map(x => x.split("'")[1]);
@aalemayhu
aalemayhu / client.js
Created July 25, 2019 16:58
Compiled Javascript of imba/hello-world-imba https://github.com/imba/hello-world-imba.git
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;