Skip to content

Instantly share code, notes, and snippets.

View westonplatter's full-sized avatar

westonplatter

View GitHub Profile
@westonplatter
westonplatter / osx_bootstrap.sh
Created June 12, 2017 21:17 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
# https://github.com/teampoltergeist/poltergeist/issues/419
class RandomController < ApplicationController
before_filter :check_initialized
require 'capybara/rails'
require 'capybara/poltergeist'
def check_initialized
unless initialized?
#
# only include once in the python notebook file
#
js = """
<script>
function removeTabs($tabs, matchPharse) {
$.each($tabs, function(index, element){
var links = $(element).find('li a');
<!doctype html>
<title>Gatecoin | Maintenance</title>
<head>
<meta charset="utf-8">
<link href='https://gatecoin.com/public/css/googleFonts.css' rel='stylesheet' type='text/css'>
<link rel="icon" href="https://gatecoin.com/public/img/favicon.ico" type="image/png"/>
<!--ramen-->
<link rel="dns-prefetch" href="https://cdn.ramen.is">
</head>
var wg sync.WaitGroup
numWorkers := 10
inputChannel := make(chan []string)
for i := 0; i < numWorkers; i++ {
wg.Add(1)
go func() {
for data := range inputChannel {
// do work
}
@westonplatter
westonplatter / echoHttpRequest.js
Last active August 29, 2015 14:21 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
hook.debug("Debug messages are sent to the debug console");
hook.debug(hook.params);
hook.debug(hook.req.path);
hook.debug(hook.req.method);
@westonplatter
westonplatter / example.go
Last active August 29, 2015 14:09 — forked from kavu/example.go
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
=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')
//
// 1. what is the resulting console.log() output?
//
// 2. why did the console.log output in the order it did?
var first = function(){
$.get("/", {
complete: function(){
console.log("first");
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*