This file contains 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
require 'sinatra' | |
get '/hello' do | |
# Update the 'last modified' time of a specific file to the current time | |
FileUtils.touch('status') | |
"Hello to you too!" | |
end | |
get '/check/:minutes' do |minutes| |
This file contains 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
#!/usr/bin/env python3 | |
import os | |
import time | |
from pathlib import Path | |
import telegram_send | |
from bottle import Bottle, route, run | |
This file contains 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
use actix_web::{get, web, App, HttpResponse, HttpServer, Responder}; | |
use std::fs; | |
use std::time::SystemTime; | |
use std::env; | |
use dotenv::dotenv; | |
// This struct represents state | |
struct AppState { | |
token: String, | |
alert_chat_id: i32, |
This file contains 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
arabic :: String -> Int | |
arabic "" = 0 | |
arabic (x:y:xs) | |
| x == 'C', y == 'M' = 900 + arabic xs | |
| x == 'C', y == 'D' = 400 + arabic xs | |
| x == 'I', y == 'X' = 9 + arabic xs | |
| x == 'I', y == 'V' = 4 + arabic xs | |
arabic (x:xs) | |
| x == 'M' = 1000 + arabic xs | |
| x == 'D' = 500 + arabic xs |
This file contains 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
import glob | |
import re | |
from collections import Counter | |
import datetime | |
import csv | |
files = glob.glob('*.*') | |
print "There are ", len(files), " files." |
This file contains 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
import pylrc | |
import sys | |
import time | |
import vlc | |
import pathlib | |
import signal | |
# Check that the user has specified the .lrc file | |
if (len(sys.argv) != 2): | |
exit(0) |
This file contains 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
I II III, IV V, VI VII, VIII, IX X, XI XII XIII XIV XV. XVI XVII XVIII, XIX, XX XXI, "XXII, XXIII, XXIV XXV!" XXVI XXVII XXVIII XXIX XXX XXXI, XXXII, XXXIII? | |
XXXIV XXXV XXXVI XXXVII XXXVIII XXXIX XL, XLI, XLII XLIII XLIV XLV. XLVI XLVII, XLVIII XLIX, L LI LII LIII LIV, LV, LVI LVII LVIII LIX LX! LXI LXII, "LXIII LXIV LXV LXVI LXVII LXVIII LXIX LXX LXXI?" LXXII LXXIII, LXXIV, LXXV LXXVI LXXVII, LXXVIII LXXIX LXXX LXXXI, LXXXII LXXXIII, LXXXIV, LXXXV LXXXVI, LXXXVII LXXXVIII LXXXIX XC XCI, XCII, XCIII, XCIV. XCV, XCVI XCVII XCVIII XCIX, C CI CII CIII CIV CV CVI CVII CVIII CIX CX CXI, "CXII CXIII CXIV CXV." CXVI CXVII, CXVIII CXIX CXX CXXI CXXII CXXIII CXXIV CXXV, CXXVI CXXVII, CXXVIII CXXIX, CXXX, CXXXI CXXXII CXXXIII CXXXIV, CXXXV CXXXVI CXXXVII, CXXXVIII CXXXIX, CXL? CXLI CXLII CXLIII CXLIV CXLV CXLVI! CXLVII, CXLVIII CXLIX CL CLI CLII CLIII CLIV CLV CLVI CLVII, "CLVIII!" | |
CLIX, CLX? CLXI CLXII CLXIII CLXIV CLXV, CLXVI CLXVII CLXVIII, CLXIX CLXX CLXXI, CLXXII CLXXIII CLXXIV CLXXV CLXXVI CLXXVII CLXXVIII CLXX |
This file contains 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
//: Playground - noun: a place where people can play | |
import UIKit | |
enum SentenceEnd: String { | |
case FullStop = "." | |
case QuestionMark = "?" | |
case ExclamationMark = "!" | |
} |
This file contains 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
var doc = context.document | |
var selectionCount = context.selection.count() | |
if (selectionCount == 0) { | |
doc.showMessage("Nothing selected.") | |
return | |
} | |
var tile = context.selection[0] |
This file contains 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
extension Locale { | |
enum DateOrder { | |
case DayFirst, MonthFirst, YearFirst | |
} | |
func dateOrder() -> DateOrder { | |
guard let formatter = DateFormatter.dateFormat(fromTemplate: "MMMMdY", options: 0, locale: self) else { | |
return .DayFirst | |
} | |
NewerOlder