Skip to content

Instantly share code, notes, and snippets.

View jwulf's full-sized avatar
:octocat:
Coding on Halmak

Josh Wulf jwulf

:octocat:
Coding on Halmak
View GitHub Profile
@docbook
docbook / rdfalite.rnc
Created May 22, 2012 12:16
DocBook 5 customization layer for RDFa Lite support
# This file IS NOT part of DocBook V5.0
#
# ======================================================================
namespace rng = "http://relaxng.org/ns/structure/1.0"
namespace s = "http://purl.oclc.org/dsdl/schematron"
namespace db = "http://docbook.org/ns/docbook"
default namespace = "http://docbook.org/ns/docbook"
include "../../schemas/docbook/docbook.rnc" {
@tmeasday
tmeasday / gist:4042603
Last active October 12, 2015 14:47
Meteor "Join" -- Note that this code is *not* production ready.
Meteor.publish 'paths', (since) ->
pointHandles = {}
publishPath = (pathId) =>
pointHandles[pathId] = Points.find({pathId: pathId}).observe
added: (obj) =>
@set('points', obj._id, obj)
@flush()
# these two should never happen
changed: (obj) =>
@jwulf
jwulf / rdfalite.rnc
Created February 15, 2013 00:37 — forked from docbook/rdfalite.rnc
# This file IS NOT part of DocBook V5.0
#
# ======================================================================
namespace rng = "http://relaxng.org/ns/structure/1.0"
namespace s = "http://purl.oclc.org/dsdl/schematron"
namespace db = "http://docbook.org/ns/docbook"
default namespace = "http://docbook.org/ns/docbook"
include "../../schemas/docbook/docbook.rnc" {
@alexhawkins
alexhawkins / nativeJavaScript.js
Last active April 28, 2024 08:52
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests
#!/usr/bin/env jjs
/*####################################################################################################################################
# As Nashorn does not have http capabilities through XMLHttpRequest (DOM API), we have to use regular Java classes instead.
# This sample shows how this can be acheived without depending on any third party libraries. Just a standard Java 8 JDK.
# Make sure to have JAVA_HOME/bin on your PATH for the shebang to work. Then just chmod +x away and run...
# Alternatively if you're on a non *nix OS, start with jjs -scritping httpsample.js
####################################################################################################################################*/
var url = "https://api.github.com/users/billybong/repos";
var response;
@scottmagdalein
scottmagdalein / clickable-element.html
Last active March 15, 2023 18:01
Make the Mailchimp Subscriber popup appear on click
<!-- This is the HTML element that, when clicked, will cause the popup to appear. -->
<button id="open-popup">Subscribe to our mailing list</button>
@luislobo
luislobo / install_latest_docker_compose.sh
Last active January 29, 2022 14:52 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@vasanthk
vasanthk / redux-light-example.js
Created June 9, 2016 00:03 — forked from bloodyowl/redux-light-example.js
redux in 14 lines of code
const store = createStore((state = { counter: 0 }, action) => {
switch(action.type) {
case "INCREMENT":
return { counter: state.counter + 1 }
case "DECREMENT":
return { counter: state.counter - 1 }
default:
return state
}
})
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"gopkg.in/yaml.v2"
)
@BretFisher
BretFisher / docker-for-mac.md
Last active July 1, 2024 10:16
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1