Skip to content

Instantly share code, notes, and snippets.

@deconstructionalism
deconstructionalism / vim8.x_with_lua
Last active July 6, 2017 00:03 — forked from techgaun/vim8.x_with_lua
Install vim with lua support + vim-plug and .vimrc on ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install build-essential liblua5.3-0 liblua5.3-dev python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim /usr/bin/vim /usr/local/bin/vim
sudo mkdir /usr/include/lua5.3/{include,lib}
sudo cp /usr/include/lua5.3/*.h /usr/include/lua5.3/include/
sudo ln -sf /usr/lib/x86_64-linux-gnu/liblua5.3.so /usr/include/lua5.3/lib/liblua.so
sudo ln -sf /usr/lib/x86_64-linux-gnu/liblua5.3.a /usr/include/lua5.3/lib/liblua.a
cd /tmp
git clone https://github.com/vim/vim.git
@deconstructionalism
deconstructionalism / .vimrc
Created July 5, 2017 23:55
.vimrc for Ubuntu
" allows indentation and syntax highlighting
filetype plugin indent on
syntax enable
" jk for Esc
:imap jk <Esc>
@deconstructionalism
deconstructionalism / general_assembly_ex_1
Last active July 12, 2017 01:57
General_Assembly_excersize_1
var names = ['Fido', 'Rufus', 'Meatyard'];
names.prototype = {
addName: function () { this.push(name) },
sayNames: function () { this.map(name => {
console.log(name)
})
}
}
// use "https://repl.it/languages/nodejs" to run code
var kennel = {
Dog: function(name, breed) {
this.name = name;
this.breed = breed;
}
}
kennel.Dog.prototype = {
  • tarragon
  • shallots
  • baby carrots
  • whole chicken
  • unsalted butter
  • maracapone
  • green onions
  • red wine - primus blend
  • spanish onions
  • cubanelles
@deconstructionalism
deconstructionalism / sha_compare.py
Created January 21, 2018 05:12 — forked from ArjunRayGA/sha_compare.py
compare SHA checksum values between two files/dirs
#!/usr/bin/env python
'''
SHA FILE/TREE COMPARATOR
takes two args:
file/dir string 1
file/dir string 2
compares all files in both locations for SHA checksum matches.
// Only verified working on Darwin Kernel Version 17.3.0 //
@deconstructionalism
deconstructionalism / take_notes.py
Created February 8, 2018 05:04
open notes and webdocs script
"""
OPEN NOTES AND DOCUMENTATION
allows for opening notes markdown file in editor of choice alongside
documentation in browser
Requirements:
- "notes" directory in path of script
- bash (tested on Darwin Kernel Version 17.3.0)
- Visual Studio Code in PATH as "code" (for current EDITOR_ARGS to work)
@deconstructionalism
deconstructionalism / Installation instructions.md
Created March 6, 2018 06:16
installation instructions for CharlesRiver CoderDojo example app, winter 2018

Installing your new project

Fork the main repo

  1. Log into your GitHub account in your browser

  2. Go to the main repo of the project: https://github.com/CharlesRiverCoderDojo/movie-app-winter-2018

  3. Click the Fork icon in the top left corner. The repo will shortly be forked to your account, showing up at an address as follows: https://github.com/<your_user_name>/movie-app-winter-2018

@deconstructionalism
deconstructionalism / .vimrc
Created April 4, 2018 03:59
2018-04-03 .vimrc
set mouse=a
set number
set tabstop=4
set shiftwidth=4
set expandtab
set colorcolumn=80
set ambiwidth=double
set background=dark
set encoding=utf8
set t_Co=256
@deconstructionalism
deconstructionalism / promise_example.js
Created April 11, 2018 04:40
Example of a simple promise and wrapping subsequent async function calls automatically in a promise
const makeAPromise = () => {
return new Promise( (resolve, reject) => {
const statusCodes = [200, 400]
// simulation of an async AJAX request
setTimeout(() => {
// pick a random status after 3 s
const status = statusCodes[Math.floor(Math.random() * statusCodes.length)]
if (status == 200) {