Skip to content

Instantly share code, notes, and snippets.

View Wingman4l7's full-sized avatar

Wingman4l7

  • Boston, MA
View GitHub Profile
@dpflug
dpflug / gist:1986830
Created March 6, 2012 15:36
Substrate by j.tarbell
// Substrate Watercolor
// j.tarbell June, 2004
// Albuquerque, New Mexico
// complexification.net
// Processing 0085 Beta syntax update
// j.tarbell April, 2005
int dimx = 250;
int dimy = 250;
@rsbohn
rsbohn / actor.py
Created March 14, 2012 13:41
Like ActionChains.py but it just does what you want. #selenium2 #webdriver #python
# Copyright 2012 Randall Bohn
# based on ActionChains.py:
# Copyright 2011 WebDriver committers
# Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@chenosaurus
chenosaurus / buy.js
Last active April 21, 2017 09:47
script to buy bitcoin on coinbase
//you will need to install node.js and restler first
//npm install restler
//run with the following command
// node buy.js
var sys = require('util'),
rest = require('restler');
//set these to your coinbase API key & the amount you want to buy
@witoff
witoff / Poll_Coinbase.js
Last active December 15, 2015 08:39
Poll Coinbase for Coin Availability
/* COMPILED:
* Add this snippet as a bookmark and click while on this url:
* https://coinbase.com/buys to check for coin availability every 60 seconds.
* Will sound an audible alarm when coins are available, if using a compliant browser (use chrome).
* Note: Don't DDOS our friends at coinbase!
*/
javascript:var%20s%3Ddocument.createElement%28%27script%27%29%3Bs.setAttribute%28%27type%27%2C%20%27text/javascript%27%29%3Bs.innerHTML%3D%22var%20beep%3D%28function%28%29%7Bvar%20ctx%3Dnew%28window.audioContext%7C%7Cwindow.webkitAudioContext%29%3Breturn%20function%28duration%2Ctype%2CfinishedCallback%29%7Bduration%3D%2Bduration%3Btype%3D%28type%255%29%7C%7C0%3Bif%28typeof%20finishedCallback%21%3D%27function%27%29%7BfinishedCallback%3Dfunction%28%29%7B%7D%7Dvar%20osc%3Dctx.createOscillator%28%29%3Bosc.type%3Dtype%3Bosc.connect%28ctx.destination%29%3Bosc.noteOn%280%29%3BsetTimeout%28function%28%29%7Bosc.noteOff%280%29%3BfinishedCallback%28%29%7D%2Cduration%29%7D%7D%29%28%29%3B%24%28%27%23transfer_btc%27%29.fo
@christianroman
christianroman / test.py
Created May 30, 2013 16:02
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
@bgrins
bgrins / export-chrome-bookmarks.js
Last active February 26, 2024 04:00
Reminder of how to export bookmarks from Chrome as text.
/*
Export bookmarks from Chrome as text.
Go to Bookmarks Manager->Organize->Export to HTML file.
Then open that file, open console and run this command:
*/
[].map.call(document.querySelectorAll("dt a"), function(a) {
return a.textContent + " - " + a.href
}).join("\n");
@lrhache
lrhache / python-selenium-open-tab.md
Last active June 10, 2023 13:49
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.

@crisu83
crisu83 / dip_bot.js
Created May 5, 2014 11:03
Small script that will help you play "Drowning in Problems" by Notch http://game.notch.net/drowning/#
/*
Open up the developer console in your browser, paste the script below, press enter and enjoy!
*/
var anchors, i;
setInterval(function() {
anchors = document.getElementsByTagName('a');
for (i = 0; i < anchors.length; i++) {
anchors[i].click();
}
@taptapdan
taptapdan / bookmarklet-load-external.js
Created May 28, 2014 23:05
How to load an external Javascript file in a bookmarklet.
javascript:(function(){document.body.appendChild(document.createElement('script')).src='http://blarb.com/external.js';})();
@mohsen1
mohsen1 / download.js
Last active March 30, 2019 05:13
Download Chromecast backgrounds
var https = require('https');
var fs = require('fs');
var url = 'https://raw.githubusercontent.com/dconnolly/chromecast-backgrounds/master/backgrounds.json';
Array.prototype.getLast = function() {
return this[this.length - 1];
};
function logFail(err){
console.log('Failed!');