Skip to content

Instantly share code, notes, and snippets.

View asifsaho's full-sized avatar
💙

Asif Nawaz asifsaho

💙
View GitHub Profile
@asifsaho
asifsaho / tkstar-tk915.adoc
Created September 14, 2024 16:27 — forked from gmarfjan/tkstar-tk915.adoc
Commands for managing a tk-start tk915 GPS tracker

TKSTAR-TK915 SMS Commands

Nota

  • <space> means space character

  • <phone number> like 00330612345678 (prefer international format)

Table 1. Admin commands
@asifsaho
asifsaho / TypeScriptCheatSheet.ts
Created February 15, 2022 09:33
Typescript Cheatsheet
// Map Object Type
const objMap: Record<string, string> = {
alu: 'mula',
};
@asifsaho
asifsaho / interview.js
Created February 15, 2022 08:51
JS interview question
console.log(add(5, 7)) // 12
console.log(add(5)(7)) // 12
console.log(add(3)(7)) // 10
function greet(greeting, punctuation) {
return greeting + ' ' + this.user + punctuation;
}
@asifsaho
asifsaho / mockComponent.ts
Created February 14, 2022 17:17
Mock React component with jest
jest.mock('./embed-code/embed-code', () => {
return {
__esModule: true,
default: () => {
return <div>Embed component goes here</div>;
},
};
});
@asifsaho
asifsaho / mysql-backup_restore.md
Last active June 22, 2020 20:06 — forked from milon/mysql-backup_restore.md
Mysql: Backup and Restore

#Mysql: Backup and Restore

Mysql Backup and restore through command line.

Backup

mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
mysqldump -u root -p --all-databases > alldb.sql

$('form.claim-details input, form select, form textarea').each(function () {
this.backup = this.value;
});
$('form.claim-details').on('change keyup', 'input,select,textarea', function () {
if (this.value !== this.backup) {
this.backup = this.value;
this.form.isDirty = true;
//$(this).addClass('field-dirty');
//$(this.form).addClass('form-dirty');
//console.log('form is dirty');
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
<?php
$to = '[email protected]';
$subject = 'Email Template Testing';
$headers = "From: " . "[email protected]" . "\r\n";
$headers .= "Reply-To: ". "[email protected]" . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
@asifsaho
asifsaho / WP:bootstrap-paginations.php
Created September 25, 2015 16:20
WP:bootstrap paginations
function custom_pagination() {
global $wp_query;
$big = 999999999; // need an unlikely integer
$pages = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'prev_next' => false,
'type' => 'array',