Skip to content

Instantly share code, notes, and snippets.

View Way's full-sized avatar

Alexander Vey Way

View GitHub Profile
anonymous
anonymous / gist:1043402
Created June 23, 2011 19:25
jung neural network stuff
public Graph<Neuron, Synapse> generateNeuroNetz(NeuronalesNetz net) {
int neuroNetCount = net.getNeuronen().size();
Graph<Neuron, Synapse> graph = new SparseMultigraph<Neuron, Synapse>();
for (Synapse synapse : net.getSynapsen()) {
Neuron start = net.getNeuronen().get(synapse.getStartNeuronID());
Neuron goal = net.getNeuronen().get(synapse.getGoalNeuronID());
graph.addEdge(synapse, start, goal, EdgeType.DIRECTED);
}
@gbakernet
gbakernet / load-google-maps.js
Created February 15, 2011 23:42
Load Google Maps API using jQuery Deferred.
/*!
* JavaScript - loadGoogleMaps( version, apiKey, language )
*
* - Load Google Maps API using jQuery Deferred.
* Useful if you want to only load the Google Maps API on-demand.
* - Requires jQuery 1.5
*
* Copyright (c) 2011 Glenn Baker
* Dual licensed under the MIT and GPL licenses.
*/
@jamescmartinez
jamescmartinez / slack_delete.rb
Last active January 4, 2021 21:28
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@scribu
scribu / backtrace-errors.php
Created October 14, 2010 07:25
Backtrace Errors
<?php
// Forked from: http://stackoverflow.com/questions/1159216/how-can-i-get-php-to-produce-a-backtrace-upon-errors/1159235#1159235
function process_error_backtrace($errno, $errstr, $errfile, $errline) {
if(!(error_reporting() & $errno))
return;
switch($errno) {
case E_WARNING :
case E_USER_WARNING :
case E_STRICT :
// HTML:
<div class="display-type"></div>
// CSS:
// set the content of an element depending on the media query
@jcppkkk
jcppkkk / OpenWithSublime.bat
Last active June 25, 2023 22:07 — forked from FoxColdMetal/OpenWithSublimeText.bat
[[[ Move to https://github.com/jcppkkk/OpenWithSublime !!! ]]] Add context menu to allow user open file or folder with Sublime as User (or as Admin).
@echo off
:: Path to Sublime Text installation dir.
SET stPath=%~dp0sublime_text.exe
SET stPathOnly=%~dp0
:: Key name for the registry entries.
SET UserEntry=Sublime Text
SET AdminEntry=Sublime Text As Admin
:: Context menu texts.
SET "UserMenuText=Open with Sublime(&-)"
SET "AdminMenuText=Open with Sublime As Admin(&+)"
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@anasnakawa
anasnakawa / wrapper.js
Created October 20, 2013 07:17
AMD / CommonJs (NodeJs) / Browser wrapper pattern
// AMD / Common Js / Browser Wrapper pattern
// copyright to [millermedeiros](https://github.com/millermedeiros/js-signals/blob/master/src/wrapper.js)
// ---------------------------------
(function(global){
var libName;
// define your library
//exports to multiple environments
if(typeof define === 'function' && define.amd){ //AMD