Skip to content

Instantly share code, notes, and snippets.

View n1crack's full-sized avatar

Yusuf Özdemir n1crack

View GitHub Profile
@n1crack
n1crack / toggle_console.ahk
Created November 4, 2022 07:51
AutoHotkey Show/Hide Terminal App with Alt+Space
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
EnvGet, LocalAppData, LocalAppData
!space::ToggleTerminal()
ToggleTerminal()
{
import tinymce from "tinymce";
require("tinymce/plugins/preview/plugin");
require("tinymce/plugins/importcss/plugin");
require("tinymce/plugins/searchreplace/plugin");
require("tinymce/plugins/save/plugin");
require("tinymce/plugins/visualblocks/plugin");
require("tinymce/plugins/fullscreen/plugin");
require("tinymce/plugins/visualchars/plugin");
require("tinymce/plugins/link/plugin");
@n1crack
n1crack / readme.md
Last active May 6, 2021 09:58
quick mongo test / docker
# create new network
docker network create my-net
# run mongo
docker run -d --name some-mongo --network my-net mongo
@n1crack
n1crack / Home.php
Last active October 1, 2023 08:51
Codeigniter4Adapter usage for ozdemir/datatables
<?php namespace App\Controllers;
use Ozdemir\Datatables\Datatables;
use Ozdemir\Datatables\DB\Codeigniter4Adapter;
class Home extends BaseController
{
public function index()
{
return view('datatables');
(?P<orderby>order\s+by)\s+(\w+\.)?(?P<column>[\.|\w]+)\s*(?P<dir>asc|desc)\s*$
@n1crack
n1crack / datatables.js
Last active November 7, 2019 05:52
dropdown example
$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#example tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" class="input is-small dt-input" placeholder="Search '+title+'" />' );
} );
$('#example tfoot th.dropdown').html( '<div class="control"><div class="select is-primary is-small"><select class="dt-input" ><option value="">Select a track</option><option value="Evil Walks">Evil Walks\t</option><option value="Snowballed">Snowballed</option></select></div></div>' );
// DataTable
@n1crack
n1crack / extend.js
Created February 1, 2019 09:48 — forked from cferdinandi/extend.js
A native JS extend() function.
/**
* Merge defaults with user options
* @private
* @param {Object} defaults Default settings
* @param {Object} options User options
* @returns {Object} Merged values of defaults and options
*/
var extend = function ( defaults, options ) {
var extended = {};
var prop;
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
// Codeigniter 3 usage :
// Set config/config.app:
// $config['composer_autoload'] = 'vendor/autoload.php';
use Ozdemir\Datatables\Datatables;
use Ozdemir\Datatables\DB\CodeigniterAdapter;
class Welcome extends CI_Controller {
public function index()
{
@n1crack
n1crack / add-column.html
Last active December 31, 2021 13:52
Datatables php library
<table border="0" class="display" id="example" width="100%">
<thead>
<tr>
<th width="8%">Id</th>
<th width="50%">Name</th>
<th width="22%">Unit Price</th>
<th width="20%">Action</th>
</tr>
</thead>
<tbody>
@n1crack
n1crack / execution_time.php
Last active November 17, 2018 16:56
code execution time #php
<?php
$time_start = microtime(true);
for($i=0; $i<1000; $i++){
// code here
}
$time_end = microtime(true);