Skip to content

Instantly share code, notes, and snippets.

@bryant988
bryant988 / zillow.js
Last active May 3, 2024 15:23
Zillow Image Downloader
/**
* NOTE: this specifically works if the house is for sale since it renders differently.
* This will download the highest resolution available per image.
*/
/**
* STEP 1: Make sure to *SCROLL* through all images so they appear on DOM.
* No need to click any images.
@idleberg
idleberg / fish_shell.md
Last active March 27, 2024 22:37
Instructions on how to install Fish shell on Mac OS X, including Oh My Fish!. Also includes several useful functions.

Installation

  1. Install fish via Brew
  2. Optionally install Oh My Fish!
  3. Add fish to known shells
  4. Set default shell to fish
brew install fish  
curl -L https://get.oh-my.fish | fish
@RobertoSchneiders
RobertoSchneiders / elasticbeanstalk_deploy_iam_policy.md
Last active October 11, 2023 11:35
IAM Policy for deploy on Elastic Beanstalk

I am deploying with this IAM using Codeship and Circle CI to Elastic Beanstalk. I had a lot of trouble with this config. I talked to the aws support for about 6 hours until this worked properly, so, I guess it is worth to share.

UPDATE: In the end, I have to use the AWSElasticBeanstalkFullAccess policy. My custom policy keep breaking every week with some new added permission or some EB internal change. Anyway, the IAM I was using is below.

This works for me with CircleCI and EB Cli.

{
    "Version": "2012-10-17",
    "Statement": [
        {
@stympy
stympy / helpscout-export.rb
Last active June 28, 2023 16:44
Script to export helpscout data
#!/usr/bin/env ruby
require 'helpscout'
require 'fileutils'
api_key = ARGV[0]
helpscout = HelpScout::Client.new(api_key)
helpscout.mailboxes.each do |box|
FileUtils.mkdir(box.name) unless File.exists?(box.name)
puts "Fetching #{helpscout.conversation_count(box.id, 'all', nil)} conversations for #{box.name}"
@jedisct1
jedisct1 / long-domain-names.txt
Last active November 26, 2022 19:34
Long domain names are long. Hopeless SEO, domains registered by cats and WTF domains.
1-tr-18su-ka-8dow-56-oo9-13swx-r-k-ife-0nj-rnq-ihb-dd-p-1-0-z-a.info.
292fu2013-1-2-3-htt-4t3l60-zqn673-w9gp7kip0422wemrzsftm-htm-com.info.
aljumahiriyahalarabiyahallibiyahashshabiyahalishtirakiyahaluzma.info.
anderson-piedmont-spartanburg-greenville-easley-spine-pain-care.info.
associationfrancaisedesdirecteursdelaphotographiedelatelevision.info.
audio-player-zawqkerrhfoepdnmvbdkslahgjvklahjkfqqqojcgrtsksmcls.info.
ausencosandwellascentisaaxwaynegossruddswanheinercrimemellifont.info.
australianpublicsectoranti-corruptionconference2009fraudrortsin.info.
bewarecrimestoppersassistcorruptpolicepoliticcrimecriminalfraud.info.
camp-the-lycian-way-camps-the-lycian-way-camping-lycian-way-map.info.
@martinklepsch
martinklepsch / random-color.clj
Last active April 23, 2022 20:07
Generate a random HEX color in cojure or clojurescript
(require '[clojure.string :as s])
;; My initial attempt
(def c [:0 :1 :2 :3 :4 :5 :6 :7 :8 :9 :A :B :C :D :E :F])
(str "#" (s/join (map name (repeatedly 6 #(rand-nth c)))))
;; Another option not using keywords (/ht locks in #clojure)
(def c [0 1 2 3 4 5 6 7 8 9 \A \B \C \D \E \F])
(str "#" (s/join (repeatedly 6 #(rand-nth c))))
;; the last line can be simplified even more (/ht xificurC in #clojure)
@subelsky
subelsky / casperjs_example.js
Created August 8, 2012 18:51
Webscraping with CasperJS, PhantomJS, jQuery, and XPath
var system = require('system');
if (system.args.length < 5) {
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code.");
phantom.exit();
}
var account = system.args[1];
var username = system.args[2];
var password = system.args[3];
@apeckham
apeckham / lucene-dash.md
Last active October 17, 2021 16:46
Add Lucene Javadocs to Kapeli Dash

Install j2d

  • wget https://github.com/iamthechad/javadoc2dash/releases/download/1.1.0/j2d-cli-1.1.0.zip
  • unzip j2d-cli-1.1.0.zip

Build Javadocs

  • wget https://archive.apache.org/dist/lucene/java/8.5.1/lucene-8.5.1-src.tgz
  • brew install ant
@terjesb
terjesb / core.clj
Created October 1, 2013 19:20
Google Analytics Core Reporting API v3 using Service Account from Clojure
(ns ga-exp.core
(:import
(com.google.api.client.googleapis.auth.oauth2 GoogleCredential$Builder)
(com.google.api.client.googleapis.javanet GoogleNetHttpTransport)
(com.google.api.client.json.jackson2 JacksonFactory)
(com.google.api.services.analytics Analytics$Builder AnalyticsScopes)))
(def HTTP_TRANSPORT (GoogleNetHttpTransport/newTrustedTransport))
(def JSON_FACTORY (JacksonFactory.))