Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cytoscape.js Test</title>
<script src="build/cytoscape.umd.js"></script>
<style>
body {
margin: 0;
<!DOCTYPE html>
<html>
<head>
<title>Edge types demo</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<!-- For loading external data files -->
<script src="https://cdnjs.cloudflare.com/polyfill/v2/polyfill.min.js?features=Promise,fetch"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cytoscape.js Test</title>
<script src="build/cytoscape.min.js"></script>
<style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cytoscape.js Test</title>
<script src="build/cytoscape.umd.js"></script>
<style>
body {
<!DOCTYPE>
<html>
<head>
<title>cytoscape-cola.js demo (compound)</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
import React, { Component } from 'react';
import { select, geoMercator, geoPath, zoom, json } from 'd3';
class WorldMap extends Component {
componentDidMount() {
this.drawMap();
window.addEventListener('resize', this.handleResize);
}
componentWillUnmount() {
@jquery404
jquery404 / PC Central.vba
Created December 20, 2018 03:23
Console - Combine - Save - Clear
Sub Console()
Dim FolderPath As String
Dim Filename As String
Dim sheet As Worksheet
Application.ScreenUpdating = False
FolderPath = GetFolder & "\"
@jquery404
jquery404 / Async HTTP call AngularJS.html
Last active November 8, 2018 07:35
Async HTTP call AngularJS
<div class="col-md-6 col-sm-6 col-xs-12">
<select
ng-change="changeCluster(1)"
ng-options="s.cluster_id as s.cluster_title for s in parentLevel"
ng-model="currentCluster.co_sub_cluster">
</select>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="clearfix">
@jquery404
jquery404 / .htaccess
Created November 1, 2018 10:26
Remove .php from .htaccess
RewriteEngine on
# Rewrite /foo/bar to /foo/bar.php
RewriteRule ^([^.?]+)$ %{REQUEST_URI}.php [L]
# Return 404 if original request is /foo/bar.php
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
var goal = 25;
var numbers = [21, 34, 12, 52, 43];
var closest = numbers.reduce(function(prev, cur){
return (Math.abs(cur-goal) < Math.abs(prev-goal)) ? cur : prev;
});
console.log(closest); // output: 21