Skip to content

Instantly share code, notes, and snippets.

View doreancl's full-sized avatar
🏠
Working from home

DoreanCL doreancl

🏠
Working from home
View GitHub Profile
@doreancl
doreancl / workflow.json
Created November 1, 2023 01:51
Pixelated Naruto
{
"last_node_id": 175,
"last_link_id": 392,
"nodes": [
{
"id": 122,
"type": "ControlNetLoaderAdvanced",
"pos": [
-679.5623567419002,
-974.8150495377753

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

Steps:

  1. Open VirtualBox
  2. Right-click your VM, then click Settings
  3. Go to Shared Folders section
  4. Add a new shared folder
  5. On Add Share prompt, select the Folder Path in your host that you want to be accessible inside your VM.
function open(elem) {
if (document.createEvent) {
var e = document.createEvent("MouseEvents");
e.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
elem[0].dispatchEvent(e);
} else if (element.fireEvent) {
elem[0].fireEvent("onmousedown");
}
}
var mySingleton = (function () {
// Instance stores a reference to the Singleton
var instance;
function init() {
// Singleton
// Private methods and variables
// Boring
if (isThisAwesome) {
alert('yes'); // it's not
}
// Awesome
isThisAwesome && alert('yes');
// Also cool for guarding your code
var aCoolFunction = undefined;
// Given a query string "?to=email&why=because&first=John&Last=smith"
// getUrlVar("to") will return "email"
// getUrlVar("last") will return "smith"
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
}
ErrorDocument 400 /error-docs/400.html
ErrorDocument 401 /error-docs/401.html
ErrorDocument 403 /error-docs/403.html
ErrorDocument 404 /error-docs/404.html
ErrorDocument 405 /error-docs/405.html
ErrorDocument 500 /error-docs/500.html
ErrorDocument 501 /error-docs/501.html
ErrorDocument 502 /error-docs/502.html
ErrorDocument 503 /error-docs/503.html
@doreancl
doreancl / index.html
Created July 17, 2013 14:19
A CodePen by DoreaNcl. Time Zone
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<div id='lala'></div>
My sweet website.
@doreancl
doreancl / checkMemory.php
Created May 7, 2013 16:33
Comprobar uso de memoria en php Check memory usage in php
<?php
echo "Memory usage before: " . (memory_get_usage() / 1024) . " KB" . PHP_EOL;
$s = microtime(true);
/***
* some code
*/
echo " ". PHP_EOL;
echo "Memory usage after: " . (memory_get_usage() / 1024) . " KB" . PHP_EOL;
@doreancl
doreancl / callerCallbacks.js
Created May 7, 2013 16:27
LLamador de callbacks fragmento caller callbacks snip
function test(a, b, c, callback){
var callback_p = callback;
var arguments_p = [].slice.apply(arguments, [4]);
callerCallbacks(callback);
}
function callerCallbacks(callback){
console.log("callerCallbacks");
if (typeof(callback) === 'function') {