Skip to content

Instantly share code, notes, and snippets.

View otengkwame's full-sized avatar
💭
Cooking some open source projects

Kwame Oteng Appiah-Nti otengkwame

💭
Cooking some open source projects
View GitHub Profile
@otengkwame
otengkwame / git_cheat-sheet.md
Created November 30, 2020 00:54 — forked from davfre/git_cheat-sheet.md
git commandline cheat-sheet
@otengkwame
otengkwame / markdown.php
Created January 3, 2021 15:23 — forked from daveh/markdown.php
Rich-text formatting in PHP: HTML, Markdown, rich-text editors like TinyMCE and doing it securely (code to accompany https://youtu.be/Udgi43MG0a4)
<?php
require "vendor/autoload.php";
$parser = new Parsedown;
?>
<!DOCTYPE html>
<html>
<head>
@otengkwame
otengkwame / arrays.php
Created February 27, 2022 03:56 — forked from recck/arrays.php
Week 3 - Day 5 - Playing with Arrays
<?php
/**
* Playing with Arrays
* List of functions: http://us2.php.net/manual/en/ref.array.php
**/
// Creating an array
$array = array('value1', 2, 'value3', 4.5);
// Remember an array starts at position 0
$.fn.select2.amd.define('select2/data/extended-ajax',['./ajax','../utils','jquery'], function(AjaxAdapter, Utils, $){
function ExtendedAjaxAdapter ($element,options) {
//we need explicitly process minimumInputLength value
//to decide should we use AjaxAdapter or return defaultResults,
//so it is impossible to use MinimumLength decorator here
this.minimumInputLength = options.get('minimumInputLength');
this.defaultResults = options.get('defaultResults');
ExtendedAjaxAdapter.__super__.constructor.call(this,$element,options);
@otengkwame
otengkwame / update_refs failed.sh
Created October 6, 2022 12:34 — forked from lordlycastle/update_refs failed.sh
When you get update_ref failed for ref error in git.
# Rename from 'C:/Users/Repos/phishfoodvr/.git/refs/remotes/origin/CHA/main.lock' to 'C:/Users/Repos/phishfoodvr/.git/refs/remotes/origin/CHA/main' failed. Should I try again? (y/n) n
# error: update_ref failed for ref 'refs/remotes/origin/CHA/main': couldn't set 'refs/remotes/origin/CHA/main'
$ cd $(git rev-parse --show-toplevel) # if necessary
$ rm -rf .git/refs/remotes/origin # remove all origin/*
$ mkdir .git/refs/remotes/origin # create empty origin/
$ git fetch origin # repopulate origin/*
@otengkwame
otengkwame / nvmCommands.js
Created December 9, 2022 04:43 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list installed versions of node (via nvm)
nvm ls
// install specific version of node
nvm install 6.9.2
// set default version of node
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,