Skip to content

Instantly share code, notes, and snippets.

View richsoni's full-sized avatar

Richard Soni richsoni

View GitHub Profile
@richsoni
richsoni / mockCityData.js
Last active January 5, 2021 17:47
WeWork Mock City Data
window.cityData = [
{name: "Abu Dhabi", country: "United Arab Emirates"},
{name: "Amsterdam", country: "Netherlands"},
{name: "Atlanta", country: "United States"},
{name: "Austin", country: "United States"},
{name: "Bangkok", country: "Thailand"},
{name: "Barcelona", country: "Spain"},
{name: "Barranquilla", country: "Colombia"},
{name: "Be'er Sheva", country: "Israel"},
{name: "Beijing", country: "Greater China"},
@richsoni
richsoni / medallia-overrides.css
Last active April 23, 2020 16:45
Medallia Overrides
* {
background: indigo !important;
}
@richsoni
richsoni / BrowserCookieSnippet.js
Last active May 28, 2019 15:07
Cookie Management Background
// Can be pasted in a Chrome console to overflow the client's cookie
sizeof = (str) => (new TextEncoder('utf-8').encode(str)).length
logSize = (str, label) => console.log('sizeof ', label || str, ' ', sizeof(str))
cookieChar='🍪';
repeat = 1000;
totalLimit=3000;
cookieVal = cookieChar.repeat(repeat);
logSize(cookieChar);
logSize(cookieVal, cookieChar+' '+'(repeat '+repeat+'X)')
body { background: #222; color: #e6e6e6; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #222; }
@richsoni
richsoni / dired.md
Last active June 2, 2016 14:12
dired

M-x dired

Updating

  • g Update the entire contents of the Dired buffer (revert-buffer).
  • l Update the specified files (dired-do-redisplay). You specify the files for l in the same way as for file operations.
  • s Toggle between alphabetical order and date/time order (dired-sort-toggle-or-edit).
  • C-u s Refresh the Dired buffer using switches as dired-listing-switches.

Deleting

  • d Flag this file for deletion.
  • u Remove deletion flag on this line.
  • x Delete the files that are flagged for deletion.
@richsoni
richsoni / gist:8332c99cf6028ae9b310
Created July 1, 2015 19:26
React Props for style
var style = {
myDiv: {
backgroundColor: 'red',
}
}
class Child extends React.Component {
render() {
return <div style={_.extend({}, style.myDiv, this.props.style, {color: 'blue'})} />
}
chmod +x yourFile
@richsoni
richsoni / remove elastic
Created September 13, 2013 14:18
Remove Elastic from vbox
> ds s
$ sudo -s
$ sudo service elasticsearch stop
$ rm -rf /usr/local/elasticsearch
$ cd /etc/init.d/
$ rm elastic*
@richsoni
richsoni / markdown_compile.vim
Created September 3, 2013 18:34
Ghetto Markdown Compiling In Vim Window
"Requires:
"lynx
"markdown.pl http://daringfireball.net/projects/markdown/
"setup (copy path to your markdown.pl in this script)
"Markdown Stuff
map <silent><leader>md :call MarkdownPreview()<cr>
function! MarkdownPreview()
"compile the markdown
let buffer = bufname("%")
@richsoni
richsoni / 1view.coffee
Created August 26, 2013 17:11
Put your backbone zombies through the woodchipper
#keep tabs on your vent bindings. If you dont kill them they will slowly walk toward your app, and suck its brains (memory) out
#################
# INSTEAD OF
# App.Vent.bind('some_event', _.bind(some_callback, this))
# App.Vent.bind('other_event', _.bind(other_callback, this))
# Do
@bindGlobalEvents
some_event: 'someCallback'