Skip to content

Instantly share code, notes, and snippets.

@Anachron
Anachron / gist:7004957
Last active December 25, 2015 16:19
Read & use npm proxy for http requests Removed linefeeds for stdout to be able to check for 'null' proxy settings.
var request = require('request');
var chp = require('child_process');
// read the npm proxy settings
chp.exec('npm config get proxy', function(error, stdout, stderr){
var options = {
// repare our target url
'uri': 'http://mimosa-data.herokuapp.com/modules'
};
// stdout consists of linefeeds
@Anachron
Anachron / gist:7006751
Created October 16, 2013 12:14
Portable NodeJS & Git-Environment in Windows
Create folders:
-------------------
apps
msysgit
node
Download Programs:
-------------------
Msysgit portable (https://code.google.com/p/msysgit/downloads/list) inside msysgit
Node binary (http://nodejs.org/download/) --> inside node
@Anachron
Anachron / gist:7054252
Created October 19, 2013 10:30
Portable Windows Programming (PWP) CLI
@echo off;
start cmd /k "set HOME=%cd%\git\etc&&set PATH=%cd%\node;%cd%\node\node_modules\.bin;%cd%\git\bin;%PATH%;&&set SSH_AUTH_SOCK=%cd%\git\etc\.ssh\agentsock"
@Anachron
Anachron / gist:7054256
Created October 19, 2013 10:30
Portable Windows Programming - SSH Agent
TASKKILL /im "ssh-agent.exe" /F
DEL "%SSH_AUTH_SOCK%" /F
FOR /F "tokens=1 delims=;" %%r IN ('ssh-agent -a %SSH_AUTH_SOCK% ') DO @(SET %%r >NUL 2>&1)
@Anachron
Anachron / core.ps1
Created December 27, 2013 21:11
Quick way how to install applications to a path of your choice in scoop.
$scoopdir = "$env:APPS\scoop"
$globaldir = "$env:APPS\scoop"
$cachedir = "$scoopdir\cache" # always local
# helper functions
function coalesce($a, $b) { if($a) { return $a } $b }
function format($str, $hash) {
$hash.keys | % { set-variable $_ $hash[$_] }
$executionContext.invokeCommand.expandString($str)
}
@Anachron
Anachron / gist:9682181
Last active August 29, 2015 13:57
Collection of Settings for custom DataTypes

##Basic

Bool

Boolean

A Boolean represents a flag, true or false.

Default: false
Nullable: false

Number

Integer

@Anachron
Anachron / gist:e7580120074d7e1a1c02
Last active August 29, 2015 14:02
eqFTP-German
define({
"ERR_LOADING" : "Laden fehlgeschlagen :(",
"SIDEPANEL_TITLE" : "eqFTP",
"SIDEPANEL_OPENCONNMANGR" : "Öffne Verbindungsmanager",
"SIDEPANEL_FILETREE_NAME" : "Name",
"SIDEPANEL_FILETREE_SIZE" : "Größe",
"SIDEPANEL_FILETREE_TYPE" : "Typ",
"SIDEPANEL_FILETREE_MODIFIED" : "Geändert",
"SIDEPANEL_CONDISCONNECT" : "Trennen/Verbinden",
"bower": {
"bowerDir": {
"clean": false
},
"copy": {
"enabled": true,
"unknownMainFullCopy": false,
"mainOverrides": {
"open-sans-fontface": [{
'fonts/Bold': 'fonts/vendor/open-sans',

A dependency loader for multiple files, perfect for folders based on class-type.

It will read file name and use conventions for good naming. Then it will be saved in a cache for later use. Basically, you never have to add or remove files from your requirejs call, its just always there. Thinking about lazy loading, to improve performance.

You will be able to optionally drop some external dependencies, which requirejs will handle for you. You can just do app.load("adminPanel").extract() and you will have your AdminView, AdminEditView, AdminTemplate, AdminEditTemplate and anything you have. You could even pass a function what the module loader should initialize (instanciate) and attach.

Think of it like a super easy way to get things done with dependency management and an filetype based structure. All templates together, all models, controllers and such. I rather group them than have a fat module directory. However, that you could also customize changing the loading syntax for the file tree.

/* global requirejs */
'use strict';
var LIVERELOAD_PORT = 35729;
var SERVER_PORT = 9000;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing