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 / overview.md
Last active July 22, 2019 17:25
The ultimate Rails/Ruby Version List

The ultimate list of Rails and Ruby versions

The list is based on the .travis.yml of each rails versions.

Rails latest min. Ruby max. Ruby
5.0.x master 2.2.2 2.2.2
4.2.x 4.2.1 1.9.3 2.2
4.1.x 4.1.10 1.9.3 2.2
4.0.x 4.0.13 1.9.3 2.2
@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>
@HusseinMorsy
HusseinMorsy / pomodoro.rb
Created March 18, 2012 00:33
script for pomodoro timer with tmux and Pomodoro-App
#!/usr/bin/env ruby
#
# for use with ugol's pomodoro app (https://github.com/ugol/pomodoro) and tmux
# use applescript to set the time
# How to use it:
# 1. Open preferences from the pomodoro app
# 2. Choose script
# 3. Set start, reset and end to: do shell script "/usr/local/bin/pomodoro reset"
# 4. set every 1 min to: do shell script "/usr/local/bin/pomodoro decrease"
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);
}