Skip to content

Instantly share code, notes, and snippets.

@bondarewicz
bondarewicz / gist:5171664
Last active December 15, 2015 00:19 — forked from padolsey/gist:527683
JS: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<?php
function pretty($elem, $class, $func_name) {
echo '<'. $elem.' class="' . $class . '">';
call_user_func($func_name);
echo '</'.$elem.'>';
}
function main_page() {
<?php
// http://en.wikipedia.org/wiki/Knapsack_problem
// http://upload.wikimedia.org/wikipedia/commons/c/c6/Knapsack_greedy.svg
// KNAPSACK BALANCER!
class Balancer
{
public static function balance($items, $key)
{
@bondarewicz
bondarewicz / Build.xml
Created February 17, 2017 09:25 — forked from NickCraver/Build.xml
Stack Overflow Build Reference Docs
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="PrepareStaticContent" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Passed in Parameters -->
<configuration></configuration>
<workingDir></workingDir>
<buildNumber></buildNumber>
<buildViews>false</buildViews>
<minifyJs>true</minifyJs>
<TargetsDirectory></TargetsDirectory>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.highlight
{
background-color:yellow;
}
@bondarewicz
bondarewicz / config.json
Created July 13, 2017 11:27 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@bondarewicz
bondarewicz / dropdown.md
Last active January 26, 2018 16:43 — forked from citrusui/dropdown.md
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@bondarewicz
bondarewicz / pre-commit
Created May 1, 2018 14:57 — forked from hraban/pre-commit.md
Git pre-commit hook (.git/hooks/pre-commit) to prevent accidentally committing debug code (add NOCOMMIT in source comment)
#!/bin/sh
# This pre-commit hook will prevent you from committing any line (or filename) containing
# the string NOCOMMIT. Use that tag in comments around source code you want to avoid
# accidentally committing, like temporary IP addresses or debug printfs.
#
# To add it to an existing repository, save it to .git/hooks/pre-commit (or append, if
# that file already exists). Remember to make executable (chmod +x ...)
#
# To automatically add this pre-commit hook to every repository you create or clone: