Skip to content

Instantly share code, notes, and snippets.

View HusseinMorsy's full-sized avatar

Hussein Morsy HusseinMorsy

  • morSystem GmbH
  • Düsseldorf, Germany
View GitHub Profile
#!/usr/bin/env ruby
## frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem "faraday", "~> 2.2"
end
class Converter
def initialize(filename)
@HusseinMorsy
HusseinMorsy / sitemap-checker.ts
Last active October 24, 2019 21:17
Sitemap checker
// using:
// deno sitemap-checker.ts 400
// start at number 400 and tests the next 200
import readFileStrSync from "https://deno.land/std/fs/mod.ts";
async function checkUrl(url: string): Promise<boolean> {
const res = await fetch(url);
return res.status == 200;
}
@HusseinMorsy
HusseinMorsy / nohlsearch.vim
Created October 22, 2019 18:10
nohlsearch
nnoremap <silent> <C-l> :<C-u>nohlsearch<CR><C-l>
@HusseinMorsy
HusseinMorsy / create-gatsby-wihtouh-gatsby-cli.md
Last active October 27, 2018 08:12
Greate a gatsby app without the gatsby-cli
  1. Create a new folder mkdir gatsby-demo && cd $_
  2. create package.json npm init -y
  3. add packages npm i react react-dom gatsby
  4. create page directory mkdir -p src/pages/
  5. create index page in src/pages/index.js:
import React from "react"

export default () => <div>Hello world!</div>
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
name: Ember.computed('appName', function() {
return this.get('appName').toLowerCase();
})
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
onClick() {
this.get('router').transitionTo('http://heise.de');
}
}
});

Select Example in Elm

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
booking: Ember.inject.service(),
stops: ["Lux", "DUS", "MUC"],
actions: {
changeDepartureStop(stop) {
this.get('booking').set('stop', stop);
}
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
type alias Model =
{ title : String, items : List Item }
@HusseinMorsy
HusseinMorsy / SimpleList-step-1.html
Last active July 30, 2016 10:35
Elm examples which outs a Shopping list. Every step outputs the same HTML
<div>
<h1>Shopping List</h1>
<ul>
<li>Apples</li>
<li>Tomatos</li>
<li>Banana</li>
</ul>
</div>