Skip to content

Instantly share code, notes, and snippets.

Adam B. liladas

Block or report user

Report or block liladas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@liladas
liladas / gource.sh
Created Jun 8, 2018 — forked from qiaoxueshi/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
View gource.sh
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
View deploys3.js
const AWS = require('aws-sdk');
const fs = require('fs');
const mime = require('mime-types')
const path = require("path");
// Base AWS config.
// AWS Reference: Make sure the profile exists in ~/.aws/credentials
// See managing access keys:
// https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html
// https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_console
@oseiskar
oseiskar / swagger-yaml-to-html.py
Last active Aug 19, 2019
Converts Swagger YAML to a static HTML document (needs: pip install PyYAML)
View swagger-yaml-to-html.py
#!/usr/bin/python
#
# Copyright 2017 Otto Seiskari
# Licensed under the Apache License, Version 2.0.
# See http://www.apache.org/licenses/LICENSE-2.0 for the full text.
#
# This file is based on
# https://github.com/swagger-api/swagger-ui/blob/4f1772f6544699bc748299bd65f7ae2112777abc/dist/index.html
# (Copyright 2017 SmartBear Software, Licensed under Apache 2.0)
#
@BrnoPCmaniak
BrnoPCmaniak / filter.py
Last active Nov 30, 2018
Pass multiple parametrs into Django filter
View filter.py
"""Pass multiple parametrs into Django filter.
Inspired by http://stackoverflow.com/a/24402622/2629036.
By this filters you can chain as many variables into parametrs as you like.
You can even make different lengths for one filter.
WARNING: You have to apply n_chain_end filter at the end of the n_chains.
Thanks to this the intial var can also be tupple.
@barseghyanartur
barseghyanartur / clean_media.py
Last active Nov 24, 2017 — forked from fabiocaccamo/clean_media.py
Clean media by deleting those files which are no more referenced by any FileField (django command)
View clean_media.py
# -*- coding: utf-8 -*-
import os
import sys
from six.moves import input
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.apps import apps
View vagrant-cheat-sheet.md

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
View launch_config_janitor.py
import time
from boto.ec2.autoscale import AutoScaleConnection
def find_unused_launch_configs():
conn = AutoScaleConnection()
autoscale_groups = conn.get_all_groups(max_records=100)
launch_configs = conn.get_all_launch_configurations(max_records=100)
launch_config_names = {lc.name for lc in launch_configs}
@andyferra
andyferra / github.css
Created Apr 30, 2012
Github Markdown CSS - for Markdown Editor Preview
View github.css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@steder
steder / aws_sg_recipe.py
Created Dec 19, 2011
Create and update AWS security groups using Python and Boto.
View aws_sg_recipe.py
#!/usr/bin/env python
"""
Recipe for creating and updating security groups programmatically.
"""
import collections
import boto
You can’t perform that action at this time.