Skip to content

Instantly share code, notes, and snippets.

View DavidLemayian's full-sized avatar
👨‍💻

David Lemayian ✨ DavidLemayian

👨‍💻
View GitHub Profile
/**
* @OnlyCurrentDoc
*/
var MAXROWS = 1000
var SEEKWELL_J_SHORT_DATES = { day: "yyyy-MM-dd", month: "yyyy-MM", year: "yyyy", dayNum: "dd", monthNum: "MM", yearNum: "yyyy", week: "W" }
var SEEKWELL_J_TIMEZONE = "UTC"
var HOST = '35.196.130.133'
var PORT = '3306'
var USERNAME = 'apps_script_demo'
@mbleigh
mbleigh / README.md
Last active May 20, 2024 22:20
Firebase Hosting Fetch All Files

Fetch All Files from Firebase Hosting

This script fetches all of the files from the currently deployed version of a Firebase Hosting site. You must be signed in via the Firebase CLI and have "Site Viewer" permission on the site in question to be able to properly run the script.

Running via NPX

npx https://gist.github.com/mbleigh/9c8680cf319ace2f506f57380da66e7d <site_name>
@herr-vogel
herr-vogel / material-ui-next-js-button.js
Last active November 16, 2021 10:14
Using Material-UI Button with Next.js Link
import React from 'react'
import Link from 'next/link'
import Button from '@material-ui/core/Button'
const ButtonLink = ({ className, href, hrefAs, children, prefetch }) => (
<Link href={href} as={hrefAs} prefetch>
<a className={className}>
{children}
</a>
</Link>
import os, sys
from datetime import datetime
from ckanapi import RemoteCKAN
API_KEY = os.getenv("CKAN_API_KEY", None)
USER_AGENT = "openafrica-client"
URL = "https://africaopendata.org"
def upload_files(directory, dataset):
@nickhargreaves
nickhargreaves / geocode_db_list.php
Last active January 27, 2016 10:30
Scrapper for geocoding list with multiple location columns
<?php
/**
* Scrapper for geocoding list with multiple location columns
* If a finer location fails, it settles for the next best thing
*
* @author http://twitter.com/nickhargreaves
*/
//Db connection
$link = mysql_connect("", "", "");
@sandervm
sandervm / commandline.txt
Last active April 22, 2022 15:15
Generate Django secret key commandline
$ python -c 'import random; print "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)])'
@pudo
pudo / eas.py
Created December 5, 2014 08:20
import requests
from lxml import html
URL = 'http://neas.environment.gov.za/portal/ApplicationsPerEAP_Report.aspx'
sess = requests.Session()
r = sess.get(URL)
doc = html.fromstring(r.content)
form = {}
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@mihi-tr
mihi-tr / Kenya-Gazette
Last active December 20, 2015 15:59
Scraping the Kenya-gazette + AlchemyAPI entity recognition.
from pyquery import PyQuery
from AlchemyAPI import AlchemyAPI
from itertools import ifilter
import re
import lxml
url="http://www.kenyalaw.org/klr/index.php?id=441"
ao=AlchemyAPI()
ao.loadAPIKey("api-key.txt")