Skip to content

Instantly share code, notes, and snippets.

View netlooker's full-sized avatar
💻
Vibe Coding 💯

NetLooker netlooker

💻
Vibe Coding 💯
View GitHub Profile
@netlooker
netlooker / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@netlooker
netlooker / d7_form_api_ajax_via_ajax_command.txt
Last active September 24, 2015 12:06
Drupal 7 - Form API - Populating field value by ajax request via ajax_command
<?php
/**
* Implements hook_form_FORM_ID_alter().
*/
function hook_form_id_form_alter(&$form, &$form_state) {
$form['field_text_1']['#prefix'] = "<div id='text-1-value'>";
$form['field_text_1']['#sufix'] = "</div>";
@netlooker
netlooker / Constant Class
Last active December 5, 2015 22:04
Project Property Helper Class
It is better to use one storage for all of hardcoded values like tid, vid, nid etc.
class ProjectProps {
$DYNAMIC_PROPERTY
const PROPERTY_NAME = 'static value';
function setDynamicProperty() {
$self::DYNAMIC_PROPERTY = dynamic_function();
}
}
#!/usr/bin/env node
'use strict';
"use latest";
var https = require('https');
var cheerio = require('cheerio');
var base = 'https://www.packtpub.com/'
var freeEbookURL = base + 'packt/offers/free-learning';
@netlooker
netlooker / README.md
Created June 16, 2017 22:44 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@netlooker
netlooker / build.properties
Created July 18, 2017 10:38 — forked from bastman/build.properties
phing example tasks
project.environment.name=local
project.name=${phing.project.name}
dir.build_xml=${project.basedir}
project.host.default=${project.environment.name}.${project.name}.mydomain.com
dir.project=${dir.build_xml}/../../..
@netlooker
netlooker / pagination.html.twig
Created March 26, 2018 14:20 — forked from SimonSimCity/pagination.html.twig
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <[email protected]>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@netlooker
netlooker / helper_controller_for_testing.patch
Created April 12, 2018 14:25
OPENEUROPA-342 - Helper Controller for testing
diff --git a/modules/oe_theme_demo/oe_theme_demo.routing.yml b/modules/oe_theme_demo/oe_theme_demo.routing.yml
new file mode 100644
index 0000000..525e6b3
--- /dev/null
+++ b/modules/oe_theme_demo/oe_theme_demo.routing.yml
@@ -0,0 +1,7 @@
+oe_theme_demo.example:
+ path: '/oe-theme-demo/example'
+ defaults:
+ _title: 'Example'
<?php
declare(strict_types=1);
namespace Cocoders\core\Application\UseCase;
use Cocoders\Core\Domain\Users;
use Cocoders\Core\Application\TransactionManager;
use Cocoders\core\Application\UseCase\RegisterUser\UserFactory;
use Cocoders\core\Application\UseCase\RegisterUser\Command;
@netlooker
netlooker / ecl_tables_helper_controller.patch
Created April 23, 2018 09:42
ECL Tables - helper controller
Index: modules/oe_theme_demo/oe_theme_demo.routing.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules/oe_theme_demo/oe_theme_demo.routing.yml (date 1523027549000)
+++ modules/oe_theme_demo/oe_theme_demo.routing.yml (date 1523027549000)
@@ -0,0 +1,7 @@
+oe_theme_demo.example:
+ path: '/oe-theme-demo/example'