Skip to content

Instantly share code, notes, and snippets.

View oscarmcm's full-sized avatar
🐍
Pythonista

Oscar Cortez oscarmcm

🐍
Pythonista
View GitHub Profile
@oscarmcm
oscarmcm / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../paper-calculator/paper-calculator.html">
<link rel="import" href="../core-ajax/core-ajax.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
@oscarmcm
oscarmcm / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
#include <iostream>
#include <conio.h>
#include <cmath>
#include <cstdlib>
#include <time.h>
#include <ctime>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
@oscarmcm
oscarmcm / hulu.zsh-theme
Created March 23, 2015 21:09
It's my custom therminal theme for oh-my-zsh
# Clean, simple, compatible and meaningful.
# Terminal command status
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
# Terminal current folder
local current_folder="%{$fg[cyan]%}%c"
# Machine name.
function machine_name {
@oscarmcm
oscarmcm / pagination.html
Created April 27, 2015 03:25
A Django template tag for pagination
{% load i18n %}
<div class="row">
<div class="col-xs-12">
<section class="paginator text-center">
<nav>
<ul class="pagination">
<li>
{% if page.has_previous %}
<a href="?page={{ page.previous_page_number }}" aria-label="Previous">
@oscarmcm
oscarmcm / render.py
Created May 22, 2015 22:13
Simple Django Template Tag that render another template tag added in a text field
# -*- coding: utf-8 -*-
from django import template
from django.template.context import Context
from django.template.defaultfilters import stringfilter
from django.template.loader import get_template_from_string
register = template.Library()
@register.filter
@oscarmcm
oscarmcm / category.html
Created June 22, 2015 22:48
Liquid template for display post categories
<ul class="tag-box inline">
{% assign tags_list = site.categories %}
{% if tags_list.first[0] == null %}
{% for tag in tags_list %}
<li><a href="#{{ tag }}">{{ tag | capitalize }} <span>{{ site.tags[tag].size }}</span></a></li>
{% endfor %}
{% else %}
{% for tag in tags_list %}
<li><a href="#{{ tag[0] }}">{{ tag[0] | capitalize }} <span>{{ tag[1].size }}</span></a></li>
{% endfor %}
var nodes = document.querySelectorAll('.day');
var items = ['#d6e685', '#8cc665', '#44a340', '#1e6823']
Array.prototype.randomElement = function () {
return this[Math.floor(Math.random() * this.length)]
}
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].getAttribute('fill') == '#eeeeee') {
@oscarmcm
oscarmcm / pyenv+virtualenv.md
Created January 7, 2017 05:30 — forked from eliangcs/pyenv+virtualenv.md
Cheatsheet: pyenv, virtualenvwrapper, and pip

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv
@oscarmcm
oscarmcm / vs.css
Last active February 26, 2019 17:09
VS CSS Fixes
.monaco-workbench .sidebar>.content {
padding-top: 10px;
padding-left: 20px;
padding-right: 20px;
}
.monaco-tl-twistie.collapsible.collapsed:not(.loading) {
margin-top: 10px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none'%3E%3Crect x='0' y='0' width='11' height='11' rx='1.5' fill='%23fff'%3E%3C/rect%3E%3Crect x='1' y='1' width='9' height='9' rx='1.5' stroke='%23333'%3E%3C/rect%3E%3Cline x1='3.5' y1='5.5' x2='7.5' y2='5.5' stroke='%23333'%3E%3C/line%3E%3Cline x1='5.5' y1='3.5' x2='5.5' y2='7.5' stroke='%23333'%3E%3C/line%3E%3C/svg%3E") !important;
}