Skip to content

Instantly share code, notes, and snippets.

@jacksonp
jacksonp / explain.sh
Last active September 18, 2021 15:04
Explaining Shell Commands in Bash
# Add this to ~/.bash_profile or ~/.bashrc
explain () {
if [ "$#" -eq 0 ]; then
while read -p "Command: " cmd; do
curl -Gs "https://www.mankier.com/api/v2/explain/?cols="$(tput cols) --data-urlencode "q=$cmd"
done
echo "Bye!"
elif [ "$#" -eq 1 ]; then
curl -Gs "https://www.mankier.com/api/v2/explain/?cols="$(tput cols) --data-urlencode "q=$1"
else
@staltz
staltz / introrx.md
Last active June 15, 2024 12:24
The introduction to Reactive Programming you've been missing
@kbradnam
kbradnam / ipython_via_miniconda.md
Created May 23, 2014 18:25
Instructions for installing iPython by use miniconda

These instructions were originally provided by Michelle Gill and lightly adapted for our use.

Running this on lab server with sysadmin account

  1. cd /Volumes/Data/Korflab/Packages/
  2. mkdir Miniconda
  3. cd Miniconda
  4. Download the Python 2 version of Miniconda: curl -O http://repo.continuum.io/miniconda/Miniconda-3.4.2-MacOSX-x86_64.sh
  5. Make executable: chmod +x Miniconda-3.4.2-MacOSX-x86_64.sh
  6. Run script: sudo ./chmod +x Miniconda-3.4.2-MacOSX-x86_64.sh
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@ungoldman
ungoldman / curl_post_json.md
Last active June 6, 2024 14:58
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@mschoebel
mschoebel / main.go
Created March 6, 2014 20:02
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
@EdCharbeneau
EdCharbeneau / Enable-Transformations.md
Last active May 6, 2024 11:44
How to enable transformations on build with Visual Studio

#Transform web.config on build

  1. Unload the project
  2. Edit .csproj
  3. Append figure 1 to the end of the file just before </Project>; v12.0 my change depending on your version of Visual Studio
  4. Save .csproj and reload
  5. Open configuration manager
  6. Add a new Configuration Name: Base. Copy settings from: Release
  7. Copy the contents of your web.config
  8. Right click Web.Config > Add Config Transformation
angular.module 'myapp', []
.controller 'DemoController', class
constructor: (@$location) ->
@field = 'Field'
method: ->
'Method'
methodWithParam: (param) ->