This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="javascript:void(function () { | |
var jsCode = document.createElement('script'); | |
jsCode.setAttribute('src', 'https://gist.githubusercontent.com/eeeschwartz/6086efb174d6dc076fc6/raw/main.js'); | |
document.body.appendChild(jsCode); | |
}())">Extract Qs</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name annotate | |
// @namespace annotate | |
// @include http://getpocket.com/a/read/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js | |
// @require http://assets.annotateit.org/annotator/v1.2.5/annotator-full.min.js | |
// @resource UI_CSS http://assets.annotateit.org/annotator/v1.2.5/annotator.min.css | |
// @grant GM_addStyle | |
// @grant GM_getResourceText | |
// @run-at document-start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
other_subaccount_sid= | |
other_phone_sid= | |
citygram_subaccount_sid= | |
master_account_sid= | |
master_account_auth_token= | |
curl -XPOST "https://api.twilio.com/2010-04-01/Accounts/$other_subaccount_sid.json" \ | |
-d "Status=closed" \ | |
-u "$master_account_sid:$master_account_auth_token" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def format_leaf_collection(geo_json) | |
esri_formatted = JSON.parse(geo_json) | |
features = esri_formatted['features'].map do |feature| | |
properties = feature['attributes'] | |
title = "Hello! Leaf collection status in your area is now '#{properties['Status']}'." | |
title += " Collection dates are #{properties['Dates']}" if properties['Dates'] | |
{ | |
type: "Feature", | |
id: properties['OBJECTID'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CKAN_BASE_URL=http://www.civicdata.com | |
CKAN_API_KEY=from-ckan-users-profile-page | |
resource_id='2691aff1-e555-48d3-9188-aebf1fa8323e' | |
fields='[{"id":"ID","type":"integer"},{"id":"Date","type":"date"},{"id":"Address","type":"text"},{"id":"Suite","type":"text"},{"id":"PermitType","type":"text"},{"id":"ConstructionCost","type":"integer"},{"id":"OwnerName","type":"text"},{"id":"Contractor","type":"text"},{"id":"parcelId","type":"text"},{"id":"lat","type":"float"},{"id":"lng","type":"float"}]' | |
curl -v $CKAN_BASE_URL/api/3/action/datastore_create \ | |
-d '{"resource_id": "'$resource_id'", "fields": '$fields', "primary_key":"ID", "force":"true"}' \ | |
-H "Authorization: $CKAN_API_KEY" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -v $CKAN_BASE_URL/api/action/resource_create \ | |
--form name="Complaints" \ | |
--form id="$resource_id" \ | |
--form package_id="$package_id" \ | |
--form format="csv" \ | |
--form url="http://104.131.23.252/datastore/dump/$resource_id" \ | |
-H "Authorization: $CKAN_API_KEY" | |
sleep 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on https://github.com/mapbox/geo-googledocs | |
// install the script and run the geocode once to set the api and key | |
// in the script window, set up a trigger in `Resources > Current Project triggers` | |
// run geocodeFromCache once a minute | |
// | |
// Global variables | |
var ss = SpreadsheetApp.getActiveSpreadsheet(), | |
sheet = ss.getActiveSheet(), | |
activeRange = ss.getActiveRange(), | |
settings = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AnyOldClass | |
attr_accessor :array_attr | |
def initialize | |
self.array_attr = [] | |
this_is_fine | |
self.array_attr = [] | |
this_also_fine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onOpen() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var entries = [{ | |
name : "Export Events", | |
functionName : "exportEvents" | |
}]; | |
sheet.addMenu("Calendar Actions", entries); | |
}; | |
function return1() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# search markdown links and convert | |
# [do some cool thing](#fn-infer) => <a name="do-some-cool-thing"></a>[do some cool thing](#do-some-cool-thing) | |
def transform(line) | |
fn_name = 'fn-infer' | |
md_regex = %r{[^`]?\[(.*)\]\(##{fn_name}\)} | |
name_regex = %r{##{fn_name}} | |
a_regex = %r{\[} | |
p line | |
if (line =~ md_regex) |