Skip to content

Instantly share code, notes, and snippets.

import re
def wordWoodyTinny(word):
c = ["W" if letter.upper() in "WODML" else "T" if letter.upper() in "TINEC" else "C" for letter in word]
return "Tinny" if "T" in c else "Woody" if "W" in c else "Middle Class"
def woodyTinny(sentence):
wordlist = re.split('\W', sentence)
mapping = [wordWoodyTinny(word) for word in wordlist]
freq = {}
@avwave
avwave / index.pug
Created September 3, 2018 10:15
React - Inbox
div.wrapper
div#inbox
div.footer.
Built with React and powered by ES6.
@avwave
avwave / bootstrap-4-invoice-template.markdown
Created August 7, 2018 07:03
Bootstrap 4 Invoice Template

Keybase proof

I hereby claim:

  • I am avwave on github.
  • I am avwave (https://keybase.io/avwave) on keybase.
  • I have a public key whose fingerprint is 093E 1CB5 9EE9 D4BC 2EFD 38B4 E5E7 1786 2139 1CC3

To claim this, I am signing this object:

set theSearchPath to "/Users/<username>"
set theResults to do shell script "find " & quoted form of theSearchPath & " -name .git 2>&1 | grep -v 'Permission denied'"
repeat with i from 1 to (count paragraphs of theResults)
set theResult to paragraph i of theResults
set theParentPath to text 1 through ((length of theResult) - 5) of theResult
set theParentAlias to POSIX file (theParentPath) as alias
tell application "Finder"
set label index of theParentAlias to 6
-- Set the last value of the previous line corresponding to label color desired
For the United States:
Begin DST: Sunday April (2+6*y-y/4) mod 7+1
End DST: Sunday October (31-(y*5/4+1) mod 7)
Valid for years 1900 to 2006, though DST wasn't adopted until the 1950s-1960s. 2007 and after:
Begin DST: Sunday March 14 - (1 + y*5/4) mod 7
End DST: Sunday November 7 - (1 + y*5/4) mod 7;
European Economic Community:
@mixin invert($amt: 100%) {
-o-filter: invert($amt);
-ms-filter: invert($amt);
-moz-filter: invert($amt);
-webkit-filter: invert($amt);
@-moz-document url-prefix() {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'invert\'><feColorMatrix in='SourceGraphic' type='matrix' values='-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0'/></filter></svg>#invert");
background-color: #000;
}
DROP TRIGGER delete_till_max;
CREATE TRIGGER delete_till_max INSERT ON recents WHEN (select count(*) from recents)>49
BEGIN
DELETE FROM recents WHERE recents.id IN (SELECT recents.id FROM recents ORDER BY recents.id limit (select count(*) -49 from recents ));
END
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [UIImage new];
self.navigationController.navigationBar.translucent = YES;
self.navigationController.view.backgroundColor = [UIColor clearColor];
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet addImage:image];
[tweetSheet setInitialText:[NSString stringWithFormat:@"%@ %@", kSHARETEXT, self.filterName]];
tweetSheet.completionHandler = ^(SLComposeViewControllerResult result) {
switch (result) {
case SLComposeViewControllerResultCancelled:
[Flurry logEvent:@"Share to twitter - cancelled"];
break;
case SLComposeViewControllerResultDone: