Skip to content

Instantly share code, notes, and snippets.

View flipjs's full-sized avatar
:octocat:
hjkl

Felipe Apostol flipjs

:octocat:
hjkl
View GitHub Profile
@flipjs
flipjs / slack-dark-mojave.js
Created May 14, 2019 02:59
Slack Dark Mode for Mojave
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
url: 'https://dark-theme.netlify.com',
success: function(css) {
$('<style></style>').appendTo('head').html(css);
}
});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
  1. Plain Strings (207): foo
  2. Anchors (208): k$
  3. Ranges (202): ^[a-f]*$
  4. Backrefs (201): (...).*\1
  5. Abba (169): ^(.(?!(ll|ss|mm|rr|tt|ff|cc|bb)))*$|^n|ef
  6. A man, a plan (177): ^(.)[^p].*\1$
  7. Prime (286): ^(?!(..+)\1+$)
  8. Four (199): (.)(.\1){3}
  9. Order (198): ^[^o].....?$
  10. Triples (507): (^39|^44)|(^([0369]|([147][0369]*[258])|(([258]|[147][0369]*[147])([0369]*|[258][0369]*[147])([147]|[258][0369]*[258])))*$)
@flipjs
flipjs / curl.md
Created August 8, 2018 07:15 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@flipjs
flipjs / instanceof.js
Created March 22, 2018 15:20
instanceof demo
class Person {
constructor(name) {
this.name = name;
}
}
class Worker extends Person {
constructor(name, profession) {
super(name);
this.profession = profession;
@flipjs
flipjs / demorgans-law.js
Last active March 18, 2018 02:27
Negating multiple logical conditions (DeMorgan's Law)
const { log } = console
const a = false
const b = true
const c = false
log('Negating multiple conditions')
log('-----')
log(!(a || b))
log(!a && !b)
@flipjs
flipjs / .vimrc
Created February 18, 2018 08:15 — forked from ddresselhaus/.vimrc
run your tests in a separate tmux pane!
" when triggering this command, vim will grab your path and line location and pass it along
map <Leader>el :call RemoteSendCommand(TestLineCommand(expand("%:p"), line(".")))<CR>
" because I'm mostly writing Elixir and making heavy use of the REPL while writing my tests,
" I made a specifc command to user with Mix, the Elixir task utility
" But I'm sure you could get this to work with vim-test or something like that
function! TestLineCommand(path, line_number)
let cmd = join(["mix test --only", " line:", a:line_number, " ", a:path], "")
return cmd
endfunction
@flipjs
flipjs / conditionalwrap.js
Created October 27, 2017 12:31 — forked from kitze/conditionalwrap.js
one-line React component for conditionally wrapping children
import React from 'react';
const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children;
const Header = ({shouldLinkToHome}) => (
<div>
<ConditionalWrap
condition={shouldLinkToHome}
wrap={children => <a href="/">{children}</a>}
>
RipGrep to Vim
run
$ rg -l text_to_search | parallel -X --tty vim
Vim diff
use `colorscheme pablo`
Fix Terminal messy screen output
run:
$ reset