Skip to content

Instantly share code, notes, and snippets.

Avatar

Hussein Morsy HusseinMorsy

View GitHub Profile
View sitemap-checker.ts
// 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;
}
View nohlsearch.vim
nnoremap <silent> <C-l> :<C-u>nohlsearch<CR><C-l>
@HusseinMorsy
HusseinMorsy / create-gatsby-wihtouh-gatsby-cli.md
Last active Oct 27, 2018
Greate a gatsby app without the gatsby-cli
View create-gatsby-wihtouh-gatsby-cli.md
  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>
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
name: Ember.computed('appName', function() {
return this.get('appName').toLowerCase();
})
});
View components.my-booking.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
onClick() {
this.get('router').transitionTo('http://heise.de');
}
}
});
View controllers.application.js
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);
}
View InterActiveList-step-1.elm
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 Jul 30, 2016
Elm examples which outs a Shopping list. Every step outputs the same HTML
View SimpleList-step-1.html
<div>
<h1>Shopping List</h1>
<ul>
<li>Apples</li>
<li>Tomatos</li>
<li>Banana</li>
</ul>
</div>
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
number1: 0,
number2: 0,
actions: {
updateName1(nameField) {
// nameField is a reference to the input-field
// the inptut value is in target.value
You can’t perform that action at this time.