Skip to content

Instantly share code, notes, and snippets.

View alemohamad's full-sized avatar

Ale Mohamad ⌘ alemohamad

View GitHub Profile
@alemohamad
alemohamad / ContentView.swift
Last active November 21, 2023 12:33
Furigana concept for SwiftUI
import SwiftUI
struct ContentView: View {
var body: some View {
HStack(spacing: 0) {
FuriganaView(moji: "振", furigana: "ふ")
FuriganaView(moji: "り")
FuriganaView(moji: "仮名", furigana: "がな")
}
}
@alemohamad
alemohamad / dev.js
Last active May 16, 2019 16:43
browserify example file
var _ = require('lodash');
var $ = require('jquery');
_([1, 2, 3, 2, 4, 5, 3, 4, 6, 7, 8, 8, 9])
.uniq()
.each(function(i) {
console.log(i);
$("#items").append("<li>" + i + "</li>");
});
@alemohamad
alemohamad / webpack.config.js
Created May 16, 2019 16:41
webpack example file
module.exports = {
entry: './src/index',
output: {
path: __dirname + '/build',
filename: 'bundle.js'
},
module: {
rules: [{
test: /\.tsx?$/,
loader: 'ts-loader',
@alemohamad
alemohamad / gulpfile.js
Created May 16, 2019 16:37
Gulp example file
const { src, dest, parallel } = require('gulp');
const pug = require('gulp-pug');
const less = require('gulp-less');
const minifyCSS = require('gulp-csso');
const concat = require('gulp-concat');
function html() {
return src('client/templates/*.pug')
.pipe(pug())
.pipe(dest('build/html'))
@alemohamad
alemohamad / Gruntfile.js
Last active May 16, 2019 16:36
grunt example file
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/<%= pkg.name %>.js',
@alemohamad
alemohamad / contact.component.html
Last active April 17, 2019 10:41
Angular 7 component with ngModel data binding.
<h1>{{ title }}</h1>
<input type="text" [(ngModel)]="title">
@alemohamad
alemohamad / app.module.ts
Last active April 17, 2019 10:50
Angular 7 app module with forms module.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { ContactComponent } from './contact/contact.component';
import { FormsModule } from '@angular/forms';
@NgModule({
declarations: [
@alemohamad
alemohamad / contact.component.html
Last active April 17, 2019 09:15
Angular 7 component with data binding.
<h1>{{ title }}</h1>
@alemohamad
alemohamad / contact.component.html
Last active April 17, 2019 09:13
Angular 7 initial component template files.
<p>
contact works!
</p>
@alemohamad
alemohamad / download-nsscreencast.rb
Created June 7, 2016 15:17 — forked from mertdumenci/download-nsscreencast.rb
Download NSScreencast videos for offline viewing in a batch
# Using this script downloads ALL the videos in NSScreencast.
# Use it wisely, it's extra load/bandwidth for the NSScreencast website.
# Usage: `EMAIL=your email PASSWORD=your password COUNT=how many videos should be downloaded? ruby download-nsscreencast.rb`
require "mechanize"
require "parallel"
mechanize = Mechanize.new
mechanize.post("https://www.nsscreencast.com/user_sessions", {"email" => ENV["EMAIL"], "password" => ENV["PASSWORD"]})
mechanize.pluggable_parser.default = Mechanize::Download