Skip to content

Instantly share code, notes, and snippets.

View lesthack's full-sized avatar
⚔️
Struggling

Jorge Hernández lesthack

⚔️
Struggling
View GitHub Profile
@codeAshu
codeAshu / pyrebase_fix_python_2.17.py
Last active July 13, 2018 04:49
Change these two functions in pyrebase to avoid the problem in closing stream.
class ClosableSSEClient(SSEClient):
def close(self):
self.should_connect = False
self.retry = 0
try:
self.resp.raw._fp.fp._sock.shutdown(socket.SHUT_RDWR)
self.resp.raw._fp.fp._sock.close()
except AttributeError:
pass
@chipoglesby
chipoglesby / index.js
Last active October 23, 2023 01:23
Automatically move the sheets in a spreadsheet into alphabetical order.
function sortSheets(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheetNameArray = [];
var sheets = ss.getSheets();
for (var i = 0; i < sheets.length; i++) {
sheetNameArray.push(sheets[i].getName());
}
sheetNameArray.sort();
for( var j = 0; j < sheets.length; j++ ) {
ss.setActiveSheet(ss.getSheetByName(sheetNameArray[j]));