Skip to content

Instantly share code, notes, and snippets.

View aleksclark's full-sized avatar

Aleks Clark aleksclark

  • Murfreesboro, TN
View GitHub Profile
@aleksclark
aleksclark / auto-eslint-ignore.ts
Last active December 21, 2023 20:10 — forked from zorji/auto-ts-ignore.ts
A script to auto add // eslint-disable-next-line or /* eslint ... to files that don't lint
/**
* A script to auto add // eslint-disable-next-line or /* eslint ... to files that don't lint
* Example usage:
* $ yarn eslint --rule '@typescript-eslint/ban-ts-comment: error' --quiet -f json -o eslint_errors.json src/ tests/
* $ yarn ts-node auto-eslint-ignore.ts eslint_errors.json
*/
import { readFile, writeFile } from 'fs/promises';
import { uniq } from 'lodash';
request:
https://login.windows.net/common/oauth2/authorize?client_id={CLIENT ID}&client_secret={CLIENT SECRET}&redirect_uri=http%3A%2F%2Fauth-dev.lvh.me%3A3000%2Fauth%2Fazure_ad%2Fcallback&resource=Microsoft.SharePoint&response_type=code&scope=MyFiles.Read%2CMyFiles.Write
response:
{"error"=>"invalid_resource", "error_description"=>"AADSTS50001: Resource 'Microsoft.SharePoint' is disabled.\r\nTrace ID: 16750e77-b8c9-4965-ae3c-a471dfc80a00\r\nCorrelation ID: 9bdba4f9-5277-48f6-b735-2548ce4aba71\r\nTimestamp: 2017-04-28 18:49:48Z"}
\documentclass[20pt]{article}
\usepackage[lyric]{songs}
\usepackage{fullpage}
\usepackage{fontspec}
\iflyric
\renewcommand{\lyricfont}{\sffamily\Large}
\renewcommand{\notefont}{\sffamily\Medium}
\fi
self.permConstructor = function(perm) {
return ko.computed({
read: function(){self.hasPerm(perm)},
write: function(val){
if (val) {
self.permissions.push(perm);
} else {
self.permissions.remove(perm);
}
@aleksclark
aleksclark / lpm.py
Created November 9, 2012 18:34
Little Ping Monitor in python
# get this: https://github.com/jedie/python-ping.git
import os
import string
from time import time, sleep
from ping import Ping
class QuietPing(Ping):
def print_failed(self):
addressable (2.2.6)
backports (2.3.0)
daemons (1.1.4)
data_objects (0.10.6)
dm-core (1.1.0)
dm-do-adapter (1.1.0)
dm-migrations (1.1.0)
dm-mysql-adapter (1.1.0)
dm-sqlite-adapter (1.1.0)
dm-timestamps (1.1.0)
@aleksclark
aleksclark / gist:1157210
Created August 19, 2011 16:10
Sinatra-authentication has n, bug
require 'sinatra'
require "digest/sha1"
require 'rack-flash'
require "dm-core"
#for using auto_migrate!
require "dm-migrations"
require "sinatra/reloader"
require 'haml'
require "sinatra-authentication"
class HotspotView
include DataMapper::Resource
property :dm_user_id, Integer, :key => true
property :hotspot_id, Integer, :key => true
belongs_to :dm_user
end
class DmUser
# already taken care of by sinatra-authentication