Skip to content

Instantly share code, notes, and snippets.

View dzole0311's full-sized avatar
:shipit:

Gjore Milevski dzole0311

:shipit:
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.12.0/mapbox-gl.css' rel='stylesheet' />
<style>
body {
@rosario
rosario / composing-software.md
Created January 17, 2018 16:13 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
@zcaceres
zcaceres / Revealing-Module-Pattern.md
Last active April 2, 2025 11:56
Using the Revealing Module Pattern in Javascript

The Revealing Module Pattern in Javascript

Zach Caceres

Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.

The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.

Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.

Using Function Scope to Create Public and Private Methods

@yumminhuang
yumminhuang / package_updates_check.py
Created March 18, 2015 20:39
Python script to check apt-get updates
#!/usr/bin/env python
#coding=utf-8
import apt
import apt_pkg
from time import strftime
import os
import subprocess
import sys
@lanius
lanius / index.html
Created May 6, 2012 03:51
Handle URL pattern in WebSocketHandler for Tornado
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tornado WebSocket Sample</title>
</head>
<body>
<input type="text" id="username" value="myname" />
<button id="connect">connect</button>
<div id="result"></div>