Skip to content

Instantly share code, notes, and snippets.

@markhorrocks
markhorrocks / test_google_sheets_apiV4.rb
Last active February 19, 2024 21:56
Editing Google Sheets with the Google::Apis::SheetsV4 Ruby Client
#! /usr/bin/ruby
require 'google/apis/sheets_v4'
require 'googleauth'
require 'googleauth/stores/file_token_store'
require 'fileutils'
OOB_URI = 'urn:ietf:wg:oauth:2.0:oob'
APPLICATION_NAME = 'Google Sheets API Test'
# -*- coding: utf-8 -*-
import scrapy
from scrapy.http.request import Request
from scrapy.selector import Selector
import urllib2
import re
import PyV8
import json
@Bouke
Bouke / gist:11261620
Last active August 3, 2023 01:46
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@bsa7
bsa7 / 1. config\deploy.rb
Last active August 29, 2015 13:56
Worked recipe at 2014.03.09 - Rails 4.0.3 + Ruby 2.1.0 + puma 2.8.0 + capistrano 2.15.5 + nginx 1.4.4
# $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Для работы rvm
require 'rvm'
require 'rvm/capistrano'
require 'bundler/capistrano'
require 'puma/capistrano'
set :application, "myapp"
set :rails_env, "production"
ssh_options[:port] = 777
set :port, 777
#! /usr/bin/env python3
'''pyCookieCheat.py
2015022 Now its own GitHub repo, and in PyPi.
- For most recent version: https://github.com/n8henrie/pycookiecheat
- This gist unlikely to be maintained further for that reason.
20150221 v2.0.1: Now should find cookies for base domain and all subs.
20140518 v2.0: Now works with Chrome's new encrypted cookies.
See relevant post at http://n8h.me/HufI1w
#############################################################################
# current prompt
#############################################################################
# \d – Current date
# \t – Current time
# \h – Host name
# \# – Command number
# \u – User name
# \W – Current working directory (ie: Desktop/)
# \w – Current working directory, full path (ie: /Users/Admin/Desktop)
@kenrett
kenrett / Selenium Cheat Sheet.md
Last active May 25, 2023 01:28
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@runlevel5
runlevel5 / puma.sh
Last active July 18, 2022 17:37
pumactl is very broken, @nemshilov and @joneslee85 wrote this bash script replacement and it works so reliably on production server. So here it is, share with the world!
#!/usr/bin/env bash
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`.
# Please modify the CONSTANT variables to fit your configurations.
# The script will start with config set by $PUMA_CONFIG_FILE by default
PUMA_CONFIG_FILE=config/puma.rb
PUMA_PID_FILE=tmp/pids/puma.pid
PUMA_SOCKET=tmp/sockets/puma.sock
@rbq
rbq / config.ru
Created April 22, 2013 21:25
Problem: not_found doesn't work at all
# coding: utf-8
require 'rack/urlmap'
require File.join(File.dirname(__FILE__), 'app')
require File.join(File.dirname(__FILE__), 'api', 'v1')
routes = Rack::URLMap.new(
'/' => Sinatra::Application,
'/api/v1/' => ApiV1
)