Skip to content

Instantly share code, notes, and snippets.

View Super-Chama's full-sized avatar
🍊
Back to office

Chamara Abesinghe Super-Chama

🍊
Back to office
View GitHub Profile
@kubiqsk
kubiqsk / date.format.js
Created July 25, 2022 07:20
PHP date() formatting in JavaScript
/*
# this will create new .format() function for Date object
# there is auto localization from Intl, but you can also set language as a 2nd argument
# all possible values were tested and compared on Apache server with PHP 8 date() function
# you can find minified version in the first comment
# examples:
new Date().format('d.m.Y H:i:s') // 25.07.2022 09:11
@rojenzaman
rojenzaman / dynmotd
Last active June 9, 2023 21:17 — forked from cha55son/dynmotd
RHEL (Centos/Fedora) dynamic motd
#!/bin/bash
# Installation:
#
# 1. nano /etc/ssh/sshd_config
# PrintMotd no
#
# 2. nano /etc/profile
# /usr/bin/dynmotd # Place at the bottom
#
@dennisreimann
dennisreimann / .travis.yml
Last active September 23, 2022 16:11
Travis-CI config for Yarn 2
language: node_js
cache:
# Yarn 2 does not store dependencies in node_modules anymore, at least not by default.
# If you are using the node-modules plugin, remove the `npm: false` line.
npm: false
# Yarn 2 caches to the local .yarn directory, not the Travis default `$HOME/.yarn`
directories:
- ./.yarn/cache
@lyquix-owner
lyquix-owner / lorem-ipsump-utf8-multibyte.txt
Created April 15, 2020 11:05
Test text string (lorem ipsum) in multiple languages and containing UTF-8 multi-byte characters (1 byte, 2 bytes, 3 bytes, and 4 bytes)
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Лорем ипсум долор сит амет, пер цлита поссит ех, ат мунере фабулас петентиум сит. Иус цу цибо саперет сцрипсерит, нец виси муциус лабитур ид. Ет хис нонумес нолуиссе дигниссим.
Λορεμ ιπσθμ δολορ σιτ αμετ, μει ιδ νοvθμ φαβελλασ πετεντιθμ vελ νε, ατ νισλ σονετ οπορτερε εθμ. Αλιι δοcτθσ μει ιδ, νο αθτεμ αθδιρε ιντερεσσετ μελ, δοcενδι cομμθνε οπορτεατ τε cθμ.
側経意責家方家閉討店暖育田庁載社転線宇。得君新術治温抗添代話考振投員殴大闘北裁。品間識部案代学凰処済準世一戸刻法分。悼測済諏計飯利安凶断理資沢同岩面文認革。内警格化再薬方久化体教御決数詭芸得筆代。
旅ロ京青利セムレ弱改フヨス波府かばぼ意送でぼ調掲察たス日西重ケアナ住橋ユムミク順待ふかんぼ人奨貯鏡すびそ。
@loilo
loilo / pass-slots.md
Last active March 27, 2024 20:58
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@filipelenfers
filipelenfers / installJdkTarGzUbuntu.sh
Last active April 22, 2024 02:02
Install JDK from tar.gz Ubuntu
#Login as root
sudo su
#create jdk directory
mkdir /opt/jdk
#uncompress, change to your file name
tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk
#check if files are there
@james2doyle
james2doyle / dd.php
Last active April 12, 2024 12:35
A implementation of "dump and die" (dd) for WordPress
<?php
if (!function_exists('dd')) {
function dd($data)
{
ini_set("highlight.comment", "#969896; font-style: italic");
ini_set("highlight.default", "#FFFFFF");
ini_set("highlight.html", "#D16568");
ini_set("highlight.keyword", "#7FA3BC; font-weight: bold");
ini_set("highlight.string", "#F2C47E");
@cortesben
cortesben / Angular-cli.md
Last active May 28, 2022 15:20
Bash commands and Angular CLI commands

#Angular-cli oh shit!

https://cli.angular.io/reference.pdf

Commands Description
ng help returns all commands with flags they can take as a param
ng new [project-name] create a brand new angular project with live server BANG!
ng init grabs name from folder that already exist
@micah1701
micah1701 / dateFormat.js
Last active November 30, 2023 21:42
Replicate PHP's native date() formatting in JavaScript for many common format types
/**
* Return a formated string from a date Object mimicking PHP's date() functionality
*
* format string "Y-m-d H:i:s" or similar PHP-style date format string
* date mixed Date Object, Datestring, or milliseconds
*
*/
function dateFormat(format,date){
if(!date || date === "")
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007