Skip to content

Instantly share code, notes, and snippets.

@timothymcmackin
timothymcmackin / get_link_title.html
Created May 30, 2018 20:56
Jekyll extension to resolve related links from front matter and create links in the output
YUI.add('couch-base', function(Y) {
var LANG = Y.Lang,
IS_BOOLEAN = LANG.isBoolean,
IS_STRING = LANG.isString,
IS_NUMBER = LANG.isNumber,
IS_OBJECT = LANG.isObject,
DATA_SOURCE = 'dataSource',
EVENT_ERROR = 'couch:error',
@mihirgokani007
mihirgokani007 / api.js
Created November 30, 2014 11:56
jquery.typeahead *dynamic data* demo
var API = (function () {
var RESULT_SIZE = 10;
var STATES = [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
@janosdebugs
janosdebugs / slices.go
Created March 1, 2023 18:41
Go slices mind-twister
firstSlice := []string{"a", "b", "c", "d", "e", "f"}
firstSlice = firstSlice[:5]
secondSlice := firstSlice
firstSlice = append(firstSlice, "g")
// This will print: [a b c d e g]
fmt.Println(firstSlice)
secondSlice = append(secondSlice, "h")
@hyrious
hyrious / nodejs-on-exit.js
Created November 22, 2020 05:04
how to do something before exit in NodeJS
// only works when there is no task running
// because we have a server always listening port, this handler will NEVER execute
process.on("beforeExit", (code) => {
console.log("Process beforeExit event with code: ", code);
});
// only works when the process normally exits
// on windows, ctrl-c will not trigger this handler (it is unnormal)
// unless you listen on 'SIGINT'
process.on("exit", (code) => {
@raandree
raandree / 1. Start-PortScan.ps1
Last active April 26, 2024 10:20
PowerShell Portscan
<#
.SYNOPSIS
Powerful asynchronus IPv4 Port Scanner
.DESCRIPTION
This powerful asynchronus IPv4 Port Scanner allows you to scan every Port-Range you want (500 to 2600 would work).
The result will contain the Port number, Protocol, Service name, Description and the Status.
.EXAMPLE
@6174
6174 / github_stacktrace.js
Last active April 26, 2024 10:20
stackTracejs
// Domain Public by Eric Wendelin http://eriwen.com/ (2008)
// Luke Smith http://lucassmith.name/ (2008)
// Loic Dachary <loic@dachary.org> (2008)
// Johan Euphrosine <proppy@aminche.com> (2008)
// Oyvind Sean Kinsey http://kinsey.no/blog (2010)
// Victor Homyakov <victor-homyakov@users.sourceforge.net> (2010)
/*global module, exports, define, ActiveXObject*/
(function(global, factory) {
if (typeof exports === 'object') {
// Node
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=3)}([function(e,t,n){n(8);var r=n(6)(n(2),n(7),null,null);e.exports=r.exports},function(e,t){e.exports=Vue},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"shaker"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n.n(r),s=n(0),a=n.n(s);o.a.component("shaker",a.a)},function(e,t,n){t=e.exports=n(5)(),t.push([e.i,"","",{version:3,sources:[],names:[],mappings:"",file:"Shaker.vue",sourceRoot:""}])},function(e,t){e.exports=function(){var e=[];return e.
@styblope
styblope / docker-api-port.md
Last active April 26, 2024 10:19
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
if(window.safari) {
// YOUTUBE HACKS for ClickToPlugin
var script = "var s = document.createElement('script'); s.textContent = 'if(!/[?&]html5=1/.test(location.search)){";
// Disable SPF
script += "ytspf={};Object.defineProperty(ytspf,\"enabled\",{\"value\":false});";
// Disable HTML5
script += "HTMLMediaElement.prototype.canPlayType=function(){return\"\";};HTMLMediaElement.prototype.nativePlay=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){if(this.className===\"CTPmediaElement\")this.nativePlay();else{this.removeAttribute(\"src\");this.load();}};";
// Disable Flash version checking...
// ... on /watch pages
script += "ytplayer={};Object.defineProperty(ytplayer,\"config\",{\"get\":function(){return ytplayer.$;},\"set\":function($){$.min_version=\"0.0.0\";$.url_v9as2=$.url;ytplayer.$=$;}});";