Skip to content

Instantly share code, notes, and snippets.

View obnux's full-sized avatar
🏠

Obeydi Abbassi obnux

🏠
View GitHub Profile
@obnux
obnux / TerminalSetup.md
Created September 16, 2022 13:39 — forked from Adam--/TerminalSetup.md
How to setup an awesome terminal for software development on Windows

Windows Terminal

Windows Terminal is a modern feature-rich open source terminal from Microsoft that runs many shells, including PowerShell. The easiest way to install it is from the Microsoft Store.

Go ahead and open Windows Terminal, which should default to PowerShell. Have a look around, it's already pretty awesome. There's support for multiple tabs, color schemes, custom fonts, custom shells, and more. We are going to customize it even further by setting up git support, customizing the prompt, installing custom fonts, setting the color scheme, and optionally adding a couple of extra tools.

posh-git and oh-my-posh

posh-git allows git information to be displayed within PowerShell and provides tab completion of git commands and branches.

oh-my-posh is a prompt theme engine for PowerShell.

@obnux
obnux / gist:14e6431b6b22e07c770e64b2b203f24c
Created October 21, 2021 00:06
Here are the correct Microsoft Office MIME types for HTTP content streaming:
Extension MIME Type
.doc application/msword
.dot application/msword
.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
.docm application/vnd.ms-word.document.macroEnabled.12
.dotm application/vnd.ms-word.template.macroEnabled.12
.xls application/vnd.ms-excel
@obnux
obnux / Common-Currency.json
Created August 19, 2021 15:07 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@obnux
obnux / mysql_dump_migration.php
Created March 24, 2021 08:40 — forked from scrubmx/mysql_dump_migration.php
Import mysql dump as laravel migration
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePostalCodesTable extends Migration {
/**
* Run the migrations.
*
@obnux
obnux / slugify.js
Created March 8, 2021 11:20 — forked from codeguy/slugify.js
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
@obnux
obnux / formdata.appenObject.js
Created March 6, 2021 00:53 — forked from everdimension/formdata.appenObject.js
Append nested object to FormData. The object can be just one level deep. For anything more complex it is recommended to rethink the way you send such data to the server.
(function() {
'use strict';
if (window.FormData) {
FormData.prototype.appendObject = function (obj, namespace) {
// EXAMPLE:
// var person = { name: 'some name', age: 87 };
// var fd = new FormData();
// fd.appenObject(obj, 'person');
@obnux
obnux / object-to-form-data.js
Created March 6, 2021 00:53 — forked from ghinda/object-to-form-data.js
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {
@obnux
obnux / gulpfile.js
Created August 1, 2020 20:32 — forked from timvandijck/gulpfile.js
Gulp Example file.
var gulp = require('gulp'),
sass = require('gulp-sass')
notify = require("gulp-notify")

concatCss = require("gulp-concat-css")
concat = require('gulp-concat')
bower = require('gulp-bower')
compass = require('gulp-for-compass')
runSequence = require('run-sequence');
gulp.task('compass', function () {
@obnux
obnux / postgres-brew.md
Created January 31, 2020 11:32 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@obnux
obnux / hosted_example.txt
Created December 24, 2019 15:37 — forked from makevoid/hosted_example.txt
JQuery DOM HighLighter (it's a basic "Inspect element" simple implementation to mimic what webkit inspector and firebug do)
http://uploads.makevoid.com/jquery_dom_highlighter.html