Skip to content

Instantly share code, notes, and snippets.

View cmilfont's full-sized avatar

Christiano Milfont cmilfont

View GitHub Profile
@cmilfont
cmilfont / peter-thiels-cs183-startup-class-01-notes-essay.md
Created January 3, 2022 00:28 — forked from harperreed/peter-thiels-cs183-startup-class-01-notes-essay.md
Notes Essays—Peter Thiel’s CS183: Startup—Stanford, Spring 2012

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

@cmilfont
cmilfont / S3-Static-Sites.md
Created December 30, 2019 21:36 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

@cmilfont
cmilfont / kafka-consumer.java
Created May 26, 2016 11:27 — forked from terrancesnyder/kafka-consumer.java
Simple example of publishing avro messages to Kafka.
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DecoderFactory;
@cmilfont
cmilfont / PDF_MERGE.md
Created April 8, 2016 18:16
A quick way to to merge PDFs into one using

NOTE: GhostScript must be intalled

Mac Install instructions

brew install gs

Then run ghostscript listing all files to merge.

;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix.
;;
;; * :use makes functions available without a namespace prefix
;; (i.e., refers functions to the current namespace).
;;
;; * :import refers Java classes to the current namespace.
;;
1) stopping all running solr processes
2) removing the solr folder BUT keep a copy of it accessible in case you need some of the old config, synonyms and such.
3) gem uninstall all related gems
> for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
4) bundle install
5) rails generate sunspot_rails:install
@cmilfont
cmilfont / app.js
Created December 5, 2013 21:33 — forked from madhums/app.js
var express = require('express');
var app = express.createServer();
require('./settings').boot(app);
app.dynamicHelpers({
base: function(){
// return the app's mount-point
// so that urls can adjust. For example
// if you run this example /post/add works
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.itextpdf.text.Chapter;
import com.itextpdf.text.Chunk;
import com.itextpdf.text.Document;
# Index
---------------------------------------------------------------------
curl -XPUT http://localhost:9200/pictures/ -d '
{
"settings": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",