Skip to content

Instantly share code, notes, and snippets.

View zoxon's full-sized avatar

Zoxon zoxon

View GitHub Profile
@zoxon
zoxon / vscode_shortcuts.md
Created April 6, 2021 03:39 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@zoxon
zoxon / colorVars.css
Created September 25, 2020 04:52 — forked from softpunch/colorVars.css
CSS Variables For Color Manipulation
/* ----
css custom properties to manipulate color
MIT - 2017 - Soft Punch
https://gist.github.com/softpunch/
set initial "main" color via HSL values.
automatically calculate harmonies and variations of that color with pure css.
harmonies are determined solely by hue.
@zoxon
zoxon / App.vue
Created January 4, 2019 12:18 — forked from lmiller1990/App.vue
<template>
<div id="app">
<p>
Pending: {{ $store.state.getInfoPending }}
</p>
<p>
{{ $store.state.getInfoData }}
</p>
</div>
</template>
@zoxon
zoxon / serve.go
Created November 21, 2018 09:22 — forked from paulmach/serve.go
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
@zoxon
zoxon / pubsub.js
Created November 4, 2018 18:24 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@zoxon
zoxon / [1] main.js
Created July 5, 2018 10:02 — forked from hfalucas/[1] main.js
[Vue.js] Authentication and Authorization
/**
* Think of this "main.js" file as your application bootstrap.
*/
import Vue from 'vue'
import Resource from 'vue-resource'
import VueRouter from 'vue-router'
import routes from './routes'
import middleware from './middleware'
@zoxon
zoxon / randomPick.js
Created February 17, 2018 14:01 — forked from Takazudo/randomPick.js
randomPick/randomNum
/* need underscore.js */
/**
* randomNum
* randomNum(3,6); => 4
*/
var randomNum = function(from, to) {
return from + Math.floor( Math.random() * (to - from + 1) );
};
@zoxon
zoxon / sessionStorage.js
Created February 17, 2018 14:00 — forked from Takazudo/sessionStorage.js
sessionStorage polyfill
/*
* Based on: http://www.quirksmode.org/js/cookies.html
* and https://github.com/wojodesign/local-storage-js/blob/master/storage.js
* and https://gist.github.com/350433
* License: http://www.opensource.org/licenses/MIT
*/
(function(window) {
'use strict';
window.sessionStorage = window.sessionStorage || {
@zoxon
zoxon / events.js
Created February 17, 2018 14:00 — forked from Takazudo/events.js
lazy event implementation
/* eventmodule */
/* Events */
var Events = {
on: function(events, callback) {
if(!this._observer) {
this._observer = $({});
}
this._observer.bind(events, callback);
@zoxon
zoxon / safariversiondetection.js
Created February 17, 2018 13:59 — forked from Takazudo/safariversiondetection.js
safari version detection
var oldSafari = (function() {
var ua = window.navigator.userAgent;
if(!/safari/i.test(ua)) {
return false;
}
if(/chrome/i.test(ua)) {
// chrome has 'Safari' in its ua.
return false;
}
if(/mobile/i.test(ua)) {