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 / 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

#!/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 / 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();
}
}
@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 / 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