Skip to content

Instantly share code, notes, and snippets.

View RSO's full-sized avatar

Remon Oldenbeuving RSO

View GitHub Profile
@RSO
RSO / h1.pac
Last active November 12, 2018 13:08
function FindProxyForURL(url, host) {
var site_list = [
"localhost",
"127.0.0.1",
"ci.inverselink.com",
"sentry.inverselink.com"
];
if (site_list.includes(host)) {
return "SOCKS5 127.0.0.1:8888";
const lazy = function(name, func) {
let cached = null;
afterEach(function() {
delete global[`$${name}`];
cached = undefined;
});
Object.defineProperty(global, `$${name}`, {
configurable: true,
get() {
@RSO
RSO / printer.js
Created February 18, 2016 09:13
Ugly hacking in Recast printer.js
case "JSXElement":
var openingLines = path.call(print, "openingElement");
if (n.openingElement.selfClosing) {
assert.ok(!n.closingElement);
return openingLines;
}
var childs = [];
var childs2 = [];
@RSO
RSO / react_perfect_scroll.coffee
Created September 14, 2014 16:10
PerfectScrollComponent React
window.ReactPerfectScrollComponent = React.createClass
displayName: 'ReactPerfectScrollComponent'
getDefaultProps: ->
suppressScrollX: true
includePadding: true
componentDidMount: ->
$(@getDOMNode()).perfectScrollbar
suppressScrollX: @props.suppressScrollX
<% content_for :base_content do %>
<h1>Application</h1>
<%= yield %>
<% end %>
@RSO
RSO / find_unimported_scss_files
Created February 20, 2014 14:25
Find scss files that you haven't imported
#!/usr/bin/env ruby
def find_imports_from root_file
imports = []
path = resolve_path root_file
return [] unless File.exists? root_file
open root_file do |f|
import_lines = f.grep(/\@import/)