Skip to content

Instantly share code, notes, and snippets.

View raejin's full-sized avatar
💭
🥺

Rae Liu raejin

💭
🥺
View GitHub Profile
@raejin
raejin / 1.json
Created August 13, 2019 17:27
iTerm2 profile
{
"Profiles": [
{
"Badge Text" : "SDE",
"Working Directory" : "\/Users\/rae_liu",
"Prompt Before Closing 2" : 1,
"Selected Text Color" : {
"Red Component" : 1,
"Color Space" : "Calibrated",
"Blue Component" : 1,
@raejin
raejin / dynamicImport.js
Last active October 26, 2018 02:26
metro
'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');
@raejin
raejin / custom.css
Last active September 28, 2018 21:05
slack
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;
@raejin
raejin / ajax-success-error-to-then.js
Created April 15, 2017 00:56
jscodeshift transform for making $.ajax call to adapt then callbacks
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)
@raejin
raejin / openvpn.md
Last active September 13, 2016 22:15
How to use OpenVPN to defeat Netflix

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

<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>
<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>
<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>
<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>
[
{
"args":
{
"to": "eol"
},
"command": "move_to"
},
{
"args":