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
# constants | |
MYCONSTANT = 123 | |
# strings | |
myString = 'a b c' | |
myString = "a b c #{expression}' | |
# lists | |
myList = [1,2,3,4,5] | |
# some methods of list: |
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
# props to codecademy.org for great interactive intro to SQL | |
# CREATE | |
CREATE TABLE mytable... | |
CREATE TABLE mytable(id INTEGER PRIMARY KEY, name TEXT); | |
# a "foreign key" is a reference to a "primary key" in another table | |
# INSERT | |
INSERT INTO mytable ... |
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
# Hello World | |
public class YourName { | |
public static void main(String[] args) { | |
System.out.println("Hello World"); | |
} | |
} | |
# Fundamental data types and examples | |
int 99 boolean true char 'a' |
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
These instructions will allow root to send email from the | |
system through a dedicated gmail account, as for example for | |
smartd monitoring. | |
Props to https://tecadmin.net/send-email-smtp-server-linux-command-line-ssmtp/ | |
for the starting point for this information. | |
Sign up for a dedicated gmail account. | |
Turn on "allow less secure apps". |
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
In /etc/smartd.conf, add a line like this before the line with DEVICESCAN in it: | |
/dev/sda -m your_email@domain.com -M test | |
The "-M test" says to send an email when smartd starts (in order to test the | |
email channel). |
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
# Ansible Playbook | |
# | |
# This will create a new Django project with a single app; and will add files and set | |
# stuff up to demonstrate a Template, a Model, a Migration, and Url includes. | |
# | |
# you must have django-admin in your PATH, probably via virtualenv, to make this work | |
# | |
# By Steve Molin. GPL. | |
--- | |
- hosts: all |
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
# other options include teradici, paperspace and fram.me | |
# variables | |
instance = instance5 | |
image = ubuntu-1604-xenial-v20171107b | |
# get update to this file | |
update: | |
curl -L https://gist.github.com/smolin/ea1f506b74e90bcb729007c50dbe25b7/raw/ > Makefile | |
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
After reading a lot of pages about Promises, this page finally started making sense for me. It's a looong read and quite advanced but there are some good nuggets that help clarify things: | |
https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html | |
#. Always end a promise compose chain with | |
catch(console.log.bind(console)) | |
#. Inside a .then() ALWAYS RETURN OR THROW never let it be 'undefined' |
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
# see also https://gist.github.com/smolin/d91b76b0eb84665e0958a1e4cf157e19 | |
(docker build .) | |
# | |
# nb: use project ID 'vc-dev-smolin-f263' NOT project name 'vc-dev-smolin': | |
docker tag alpine gcr.io/vc-dev-smolin-f263/alpine | |
# docker 'login' against a remote image repo (nb: this isn't really a login in | |
# traditional sense, it only makes available a credential for use in future | |
# interactions): |
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
# Github | |
## fatal: The upstream branch of your current branch does not match the name of your current branch. | |
git branch -u origin/$(git rev-parse --abbrev-ref HEAD) | |
# Undo |
OlderNewer