Skip to content

Instantly share code, notes, and snippets.

@danwhitston
danwhitston / wsl_first_time_setup.sh
Last active May 7, 2022 13:34
Setting up my WSL environment - includes git & key, rbenv, rbenv ruby-build, attis, imagemagick, ruby, bundler, mysql, mongodb, redis
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
ln -s "/mnt/c/Users/Daniel/Documents/homeflow" ~/homeflow
ln -s "/mnt/c/Users/Daniel/Documents" ~/documents
mkdir .ssh
cp documents/id* .ssh/
sudo chmod 600 .ssh/*
cd homeflow/attis
git pull
@Coconuthack
Coconuthack / index.html
Last active November 7, 2016 15:55
UD Creative Remix
<div class="def-panel" id="UDDIV_1">
<div id="UDDIV_2">
<div id="UDDIV_4">
Top Definition
</div>
<div class="share small-6 columns" id="UDDIV_5">
<a href="" target="_blank" id="UDA_6">
<i class="svgicon svgicon-ud_twitter" id="UDI_7">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34" id="UDsvg_8"><path d="M7.3 8c5.4 2.8 9.9 2.6 9.9 2.6s-1.7-6.2 3.6-8.9 9 1.9 9 1.9.9-.3 1.6-.5c.7-.3 1.7-.7 1.7-.7l-1.6 3 2.5-.3s-.3.5-1.3 1.4l-1.4 1.4s.4 7.4-3.4 13.1c-3.8 5.7-8.7 9.1-15.9 9.9C4.9 31.6.2 28.6.2 28.6s3.1-.2 5.1-1 4.9-2.8 4.9-2.8-4.1-1.3-5.5-2.7c-1.5-1.4-1.8-2.3-1.8-2.3l4-.1s-4.2-2.3-5.4-4.1S0 12.1 0 12.1l3.1 1.3S.5 9.8.2 7s.5-4.3.5-4.3S1.9 5.2 7.3 8z" id="UDpath_9"></path></svg>
</i>
@amysimmons
amysimmons / js-tricky-bits.md
Last active November 16, 2022 02:42
Understanding closures, callbacks and promises in JavaScript

#Understanding closures, callbacks and promises

For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.

10 months into my full-time dev career, and I would struggle to explain these words to a peer.

So I decided it was time to face my fears, and try to get my head around each concept.

Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.

@mdang
mdang / RAILS_CHEATSHEET.md
Last active April 13, 2024 15:36
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@dideler
dideler / 0-startup-overview.md
Last active April 29, 2024 13:10
Startup Engineering notes
@VRMink
VRMink / gist:5169211
Last active January 6, 2020 20:31
How to setup a private node.js web server with SSL authorization

Secure private web server with NodeJS

This article will explain how to set up a secure web server with NodeJS which only accepts connection from users with SSL certificates that you have signed. This is an efficient way to ensure that no other people are able to access the web server, without building a login system which will be significantly weaker.

I will not explain how to create a certificate authority (CA), create certificates or sign them. If you need to read up on this, have a look at this excelent article on how to do it with OpenSSL (Mac and Linux): https://help.ubuntu.com/community/OpenSSL#Practical_OpenSSL_Usage It is also possible to do this on a Mac with the keychain application, and I assume it is possible on a Windows machine aswell.

This architecture will allow you to have one web server communicating with an array of trusted clients, the web server itself can be on the public internet, that will not decrease the level of security, but it will only ser

@awidegreen
awidegreen / vim_cheatsheet.md
Last active April 30, 2024 16:14
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@marioBonales
marioBonales / .bashrc
Created January 19, 2012 03:56
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt