Instantly share code, notes, and snippets.

View dynamicImport.js
'use strict';
const host = 'http://localhost:8082'
const dynamicImport = require;
module.exports = function (moduleID, importPath) {
const head = document.getElementsByTagName('head')[0];
const promise = new Promise((resolve, reject) => {
const script = document.createElement('script');
View custom.css
code, pre, .c-mrkdwn__code, .c-mrkdwn__pre {
font-family: 'Inconsolata-dz' !important;
}
#msg_input, #msg_input+#primary_file_button {
border-color: rgba(160,160,162,.7)!important;
}
#msg_form #primary_file_button:not(:hover):not(.active) {
color: #A0A0A2!important;
View ajax-success-error-to-then.js
export default function transformer(file, api) {
const j = api.jscodeshift;
let isModified = false;
const codemod = j(file.source)
// find [$.ajax] looking code snippet
.find(j.MemberExpression)
View openvpn.md

This simple solution costs around $0.10 dollars per hour. Only need to pay it when needed, very elegant and cost effective. It is mostly guaranteed that it'll work without worrying about the VPN being banned.

Requirement

  • Amazon EC2 t2.micro instance
  • OpenVpn host software image, community version (which supports up to 2 concurrent connections)
  • Tunnleblick

Guide

View universal-paren-semicolon.sublime-snippet
<snippet>
<content><![CDATA[
($1);
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>&#59;&#41;</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
View js-fnn.sublime-snippet
<snippet>
<content><![CDATA[
function (${1:params}) {
$2
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>fnn</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
View js-console-log.sublime-snippet
<snippet>
<content><![CDATA[
console.log($1);
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>lg</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
View js-binding.sublime-snippet
<snippet>
<content><![CDATA[
function () {
$1
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>fn</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
View double-semicolon.sublime-macro
[
{
"args":
{
"to": "eol"
},
"command": "move_to"
},
{
"args":
View eol-semicolon.sublime-macro
[
{
"args":
{
"to": "eol"
},
"command": "move_to"
},
{
"args":