Skip to content

Instantly share code, notes, and snippets.

View dahabit's full-sized avatar

Ahmed Abu Eldahab dahabit

View GitHub Profile
@dahabit
dahabit / SemanticsProperties.csv
Created November 22, 2021 06:11 — forked from salihgueler/SemanticsProperties.csv
SemanticsProperties
property explanation
enabled It represents the subtree or the widget that is used can be either enabled or disabled state.
checked It represents checked state of a widget similar to checkbox.
toggled It represents on/off state of a widget similar to switch.
selected It indicates that this subtree represents a widget that can be in selected/unselected state.
button It represents a button is in this subtree.
header It represents a header is in this subtree
textfield It represents a text field is in the subtree
focused It represents that current node holds the input focus. It's not the same with Accessibility Focus
inMutuallyExclusiveGroup It represents if the node is in a mutually exclusive group. E.g. Radiobutton in radio group.
@dahabit
dahabit / node_nginx_ssl.md
Created March 29, 2020 09:29 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

import 'model.dart';
typedef OnChatMessageCallback = void Function(int index, ChatMessage message);
abstract class ChatManager {
ChatManager();
ChatSession getNamedSession(String name);
}
@dahabit
dahabit / slack-file-killer.js
Created October 4, 2017 13:01 — forked from iamstuartwilson/slack-file-killer.js
Kill multiple slack files from your browser console. Simply paste this code when on the "https://[space].slack.com/files/[me]" page.
(function(){
$('#files_list > [data-file-id]').each(function(i) {
killIt($(this).attr('data-file-id'));
function killIt(id) {
console.log(id);
$.post('/api/files.delete', {
file: id,
token: boot_data.api_token
@dahabit
dahabit / .htaccess
Created January 22, 2017 20:02
CI: Simple .htaccess using mod_rewrite for CodeIgniter
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
@dahabit
dahabit / after.sh
Created February 3, 2016 08:55 — forked from cluppi/after.sh
Turning SSL on for Homestead
#!/bin/sh
# Config for SSL.
echo "--- Making SSL Directory ---"
mkdir /etc/nginx/ssl
echo "--- Copying $i SSL crt and key ---"
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com"
echo "--- Turning SSL on in nginx.conf. ---"

Files

The basic structure of a React+Flux application (see other examples)

 - /src/actions/AppActions.js     - Action creators (Flux)
 - /src/components/Application.js - The top-level React component
 - /src/constants/ActionTypes.js  - Action types (Flux)
 - /src/core/Dispatcher.js        - Dispatcher (Flux)
 - /src/stores/AppStore.js        - The main store (Flux)
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@dahabit
dahabit / .vimrc
Created October 4, 2013 19:32 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15