Skip to content

Instantly share code, notes, and snippets.

@hamzamu
hamzamu / server.js
Created Apr 22, 2021
Meteor Working directory Absolute Path*
View server.js
import * as path from 'path';
var absoluteBasePath = path.resolve(process.cwd(), '../../../../../');
var absoluteBasePath = path.resolve(process.cwd()).split(path.sep + '.meteor')[0];
@hamzamu
hamzamu / App.swift
Created Feb 19, 2021 — forked from randomor/App.swift
SwiftUI 2020 + CloudKit + Core Data ZenJournal prototype: https://thezenjournal.com
View App.swift
import SwiftUI
import CoreData
let appTransactionAuthorName = "app"
@main
struct ZenJournalApp: App {
var body: some Scene {
WindowGroup {
@hamzamu
hamzamu / admin.py
Created Dec 26, 2020 — forked from rchrd2/admin.py
Adding custom views to django's admin
View admin.py
from django.contrib import admin
from polls.models import Poll, Choice
from django.contrib.auth.models import User
from django.contrib.admin import AdminSite
from polls.views import index
class MyAdminSite(AdminSite):
View Using Git to Manage a Live Web Site.md

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@hamzamu
hamzamu / remove-node-modules.md
Created Aug 21, 2020 — forked from lmcneel/remove-node-modules.md
How to remove node_modules after they have been added to a repo
View remove-node-modules.md

How to remove node_modules

  1. Create a .gitignore file in the git repository if it does not contain one

touch .gitignore 2. Open up the .gitignore and add the following line to the file

node_modules 3. Remove the node_modules folder from the git repository

@hamzamu
hamzamu / bulma.js
Created Jul 23, 2020
Bulma Clanedar
View bulma.js
var options = {
type: data.type || 'date',
minDate: new Date(),
// displayMode:'dialog',
showHeader: false,
// maxDate: '2018-12-31',
// dateFormat: 'yyyy-mm-dd',
isRange: false,
// showTodayButton: true,
// enableYearSwitch: true
@hamzamu
hamzamu / server.js
Created Jun 21, 2020
Meteor Picker API: Upload files thru REST API.
View server.js
import {
WebApp
} from 'meteor/webapp'
import bodyParser from 'body-parser'
const fs = require('fs');
const fse = require('fs-extra')
const path = require('path');
const multer = require('multer');
@hamzamu
hamzamu / simple_rsa
Last active Jun 21, 2020 — forked from chj1768/simple_rsa
RSA encryption / decryption example (nodejs) & Meteor
View simple_rsa
openssl key pair generate
//client - using meteor.js
const nodersa = Npm.require('node-rsa');
import { HTTP } from 'meteor/http';
const syncPost = Meteor.wrapAsync( HTTP.post, HTTP );
encryptStringWithRsaPublicKey( data ) {
const absolutePath = Assets.absoluteFilePath( "public.key" ); //public key file path
const publicKey = fs.readFileSync( absolutePath, "utf8" );
@hamzamu
hamzamu / curl.md
Created Jun 14, 2020 — forked from subfuzion/curl.md
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@hamzamu
hamzamu / imap-search
Created Jun 13, 2020 — forked from martinrusev/imap-search
IMAP Search criteria
View imap-search