Skip to content

Instantly share code, notes, and snippets.

Avatar

Hamza Mousa hamzamu

View GitHub Profile
@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
@hamzamu
hamzamu / examples.md
Created Apr 26, 2020 — forked from ErisDS/examples.md
Ghost Filter Query examples
View examples.md

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

@hamzamu
hamzamu / addvhost.sh
Created Apr 22, 2020 — forked from runbrun/addvhost.sh
bash script to create nginx virtual hosts
View addvhost.sh
#!/usr/bin/env bash
#
# Nginx - new server block
# http://rosehosting.com
read -p "Enter username : " username
read -p "Enter domain name : " domain
# Functions
ok() { echo -e '\e[32m'$domain'\e[m'; } # Green
die() { echo -e '\e[1;31m'$domain'\e[m'; exit 1; }
@hamzamu
hamzamu / client.js
Created Apr 20, 2020
Meteor- browser console stats snippet
View client.js
getStats = function () {
Meteor.call('getStats', null, (err, data) => {
if (data) {
App.setSetting({
stats: data
})
}
})
return "Getting Statistics"
}
@hamzamu
hamzamu / stream_to_youtube.sh
Created Mar 23, 2020 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
View stream_to_youtube.sh
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
You can’t perform that action at this time.