startswith()
std::string s = "tititoto";
if (s.rfind("titi", 0) == 0) {
// s starts with prefix
}
#!/usr/bin/env bash | |
# How to use: | |
# | |
# 1. Start a new bash session | |
# 2. source the completions script "source scd-completions.bash" or Copy the script in /etc/bash_completion.d/ | |
# for automatic loading | |
# 3. scd <search-string>[TAB][TAB] | |
# |
scd() { | |
# [s]mart cd : find absolute paths & automatically switch to them | |
if [[ $1 != "" ]]; then | |
case $1 in | |
[".."]* ) cd .. || exit;; | |
["-"]* ) cd - || exit;; | |
["/"]* ) cd / || exit;; | |
* ) while read -r value; do | |
files+=($value) |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'> | |
<meta http-equiv='X-UA-Compatible' content='IE=edge'> | |
<meta name='viewport' content="width=device-width,height=device-height, initial-scale=1, shrink-to-fit=yes"> | |
<!--theme colors --> | |
<meta name="theme-color" content="" /> |
# Demo Scheduler Program | |
import schedule | |
import time | |
def job(): | |
print("Today is " + day + " and time is " + t) | |
day = str(input("Enter Day(sunday/monday etc) : ")) | |
t = str(input("Enter Time (hh:mm) : ")) |
#!/usr/bin/env python | |
''' Simple script to auto-generate the README.md file for a til project. | |
NOTE: Someone who wanted to be fancy would actually use a template engine | |
for this, but this seemed like a task for which it is best to only require | |
python. This is not a general purpose script, but tailored for the format | |
being used for "Today I Learned" repos. | |
Apply as a git hook by running the following command in linux: | |
cd .git/hooks/ && ln -s ../../createReadme.py pre-commit && cd - | |
''' | |
from __future__ import print_function |
pre.highlight { | |
background-color: #282923; | |
padding: 7px 7px 7px 10px; | |
border: 20px solid yellowgreen; | |
-moz-box-shadow: 3px 3px rgba(0,0,0,0.1); | |
-webkit-box-shadow: 3px 3px rgba(0,0,0,0.1); | |
box-shadow: 3px 3px rgba(0,0,0,0.1); | |
margin: 20px 0 20px 0; | |
overflow: auto; |
<!--
https://docs.google.com/forms/d/e/1FAIpQLSfim3RiM1NLrTszkwOv2uJ8mFMfZR6WZU-qKK6oRUlgA9vjuw/viewform?usp=pp_url&entry.389706550=Karma&entry.1867581834=Bitch&entry.973008035=Hellllllllooooo
-->