Skip to content

Instantly share code, notes, and snippets.

# Had to show a friend how Euc algorithm for GCD works real quick
def euc(m, n):
r = m % n
if (r != 0):
euc(n, r)
else:
return n
@Zyst
Zyst / clearly.css
Last active March 31, 2016 23:38
The CSS I use for Clearly, saving it here to have access to it in case I need a backup
/*
Background color: #222233
Foreground color: #D1D1D1
Links color: #64BEFA
Base font size: 24px
Line height: 1.5em
Line width: 36em
Monospace font: Menlo, Monospace, Consolas
Body/header font: BlinkMacSystemFont (Won't work outside of OS X)
Base CSS: Newsprint
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace epsilon_greedy
{
class Program
var StarsFrame = React.createClass({
render: function() {
let stars = [];
for (let i = 0; i < this.props.numberOfStars; i++) {
stars.push(
<span key={i} className="glyphicon glyphicon-star"></span>
);
}
// Subtracts the number of days to a Date and returns it
Date.prototype.subtractDays = function(days) {
var dat = new Date(this.valueOf());
dat.setDate(dat.getDate() - days);
return dat;
}
import mongoose, { Schema } from 'mongoose';
const StepSchema = new mongoose.Schema({
name: { type: String, required: true },
description: String,
position: { type: Number, required: true },
date_added: { type: Date, default: Date.now },
date_modified: { type: Date, default: Date.now },
templates: [{ type: Schema.Types.ObjectId, ref: 'Template' }],
active: { type: Boolean, default: true },
@import url('https://fonts.googleapis.com/css?family=Roboto');
@font-face {
font-family: 'Roboto';
src: url("https://fonts.googleapis.com/css?family=Roboto:300");
}
@font-face {
font-family: 'Source Sans Pro Semibold';
src: url("chrome-extension://dgmanlpmmkibanfdgjocnabmcaclkmod/fonts/SourceSansPro-Semibold.ttf");
@Zyst
Zyst / gist:70621d54a99dc2fff2a2697ab0e00a23
Created March 22, 2017 05:49 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@Zyst
Zyst / git-bash-as-term
Created April 15, 2018 20:03
NeoVim use git bash as terminal
:term "C:\Program Files\Git\bin\bash.exe"
@Zyst
Zyst / snippets-js.json
Created April 26, 2018 15:20
My JS VS Code snippets
{
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",