Skip to content

Instantly share code, notes, and snippets.

View johnsage25's full-sized avatar
🏠
Working from Office

John Nwanosike johnsage25

🏠
Working from Office
View GitHub Profile
@johnsage25
johnsage25 / gist:61ca15813b91c1e0db04ebef59bfe0a7
Created March 2, 2022 15:32 — forked from jesusprubio/gist:4066845
Kamailio.cfg with SIP over websockets support included.NOTE: For GRUU support change (line 363): modparam("registrar", "gruu_enabled", 1)
#!KAMAILIO
#
# Kamailio (OpenSER) SIP Server v4.1 - default configuration script
# - web: http://www.kamailio.org
# - git: http://sip-router.org
#
# Direct your questions about this file to: <[email protected]>
#
# Refer to the Core CookBook at http://www.kamailio.org/wiki/
# for an explanation of possible statements, functions and parameters.
@johnsage25
johnsage25 / laravel-encrypt.js
Created January 23, 2022 00:06 — forked from huzemin/laravel-encrypt.js
laravel Encrypt convert to CryptoJS in Javascript
import CryptoJS from "crypto-js";
const LaravelEncrypt = function (key) {
this.key = key;
}
LaravelEncrypt.prototype.decrypt = function (encryptStr) {
encryptStr = CryptoJS.enc.Base64.parse(encryptStr);
let encryptData = encryptStr.toString(CryptoJS.enc.Utf8);
encryptData = JSON.parse(encryptData);
@johnsage25
johnsage25 / css-timeline-with-custom-properties.markdown
Created November 4, 2021 01:29
CSS Timeline with Custom Properties
@johnsage25
johnsage25 / iterm2-solarized.md
Created November 1, 2021 23:04 — forked from b-barry/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@johnsage25
johnsage25 / Install Composer using MAMP's PHP.md
Created December 23, 2020 19:03 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@johnsage25
johnsage25 / flip.js
Created October 18, 2020 18:31 — forked from jasny/flip.js
Turn text upside down with JavaScript
//this script is based on coding by Reverse Fad http://www.revfad.com
function flip() {
var result = flipString(document.f.original.value.toLowerCase());
document.f.flipped.value = result;
}
function flipString(aString) {
var last = aString.length - 1;
var result = new Array(aString.length)
for (var i = last; i >= 0; --i) {
var c = aString.charAt(i)
@johnsage25
johnsage25 / firestoreTransforms.js
Created July 28, 2020 16:39 — forked from samthecodingman/firestoreTransforms.js
A collection of helper functions for transforming the results of Firebase Cloud Firestore Queries.
/*! firestoreTransforms.js | Samuel Jones 2019 | MIT License | gist.github.com/samthecodingman */
/**
* @file A file containing common firestore idioms used with queries
* @author Samuel Jones 2017 (github.com/samthecodingman)
* @license MIT
* @module firestore-transforms
*/
/**
{
"ab":{
"name":"Abkhaz",
"nativeName":"аҧсуа"
},
"aa":{
"name":"Afar",
"nativeName":"Afaraf"
},
"af":{
@johnsage25
johnsage25 / react-native-offline-bundling-android
Created June 26, 2020 22:30 — forked from erikyuntantyo/react-native-offline-bundling-android
Build react-native offline bundling into android
# create assets folder in the current project
$ mkdir android/app/src/main/assets
# create bundle script
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
# execute command to run android to create debug apk
$ react-native run-android
# Or change to android folder
@johnsage25
johnsage25 / ffmpeg-compress-mp4
Created June 14, 2020 21:18 — forked from lukehedger/ffmpeg-compress-mp4
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4