Skip to content

Instantly share code, notes, and snippets.

@ricardocabral
ricardocabral / trello_json_to_xls.py
Created September 2, 2016 14:38
Convert the JSON file exported by Trello into Excel
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson, pandas
data = simplejson.loads(open('f877UwgO.json').read())
data2=[]
to_del = ['attachments',
'badges',
'checkItemStates',
@bearfrieze
bearfrieze / comprehensions.md
Last active December 23, 2023 22:49
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

by Bjørn Friese

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

@ja-k-e
ja-k-e / Tracking Interaction in YouTube and Vimeo iFrame APIs.markdown
Last active January 17, 2018 18:54
Tracking Interaction in YouTube and Vimeo iFrame APIs

Tracking Interaction in YouTube and Vimeo iFrame APIs

An example of recording iframe-embedded video player states for both YouTube and Vimeo.

A Pen by Jake Albaugh on CodePen.

License.

@honkskillet
honkskillet / byte-sizetuts.md
Last active June 18, 2022 14:18
A series of golang tutorials with youtube videos.
@supinf
supinf / s3-invalidation.js
Last active January 7, 2023 08:57
AWS Lambda script:: CloudFront Invalidations which are triggered by s3 events.
console.log('Loading event');
var Q = require('q');
var aws = require('aws-sdk');
var cloudfront = new aws.CloudFront();
exports.handler = function (event, context) {
//_log('Received event: ', event);
var bucket = event.Records[0].s3.bucket.name;
@vlasovskikh
vlasovskikh / tweetread.py
Created June 1, 2014 23:26
Actor-based CLI Twitter client example for using asyncio
# Copyright (c) 2014 Andrey Vlasovskikh
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@koba04
koba04 / app.css
Last active April 1, 2019 08:30
socket.io chat sample by vue.js http://socket.io/get-started/chat/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font: 13px Helvetica, Arial;
}
@madjar
madjar / scrapper.py
Last active March 5, 2023 15:02
A example of scrapper using asyncio and aiohttp
import asyncio
import aiohttp
import bs4
import tqdm
@asyncio.coroutine
def get(*args, **kwargs):
response = yield from aiohttp.request('GET', *args, **kwargs)
return (yield from response.read_and_close(decode=True))
@fred
fred / gist:6248817
Created August 16, 2013 10:28
ruby script to clone/copy Iron IO cache (using celluloid pool)
require 'celluloid'
class IronQueueWorker
include Celluloid
def initialize
@token = "your-token"
@old_project_id = "source-project-id"
@new_project_id = "source-project-id"
@old_iron_cache = IronCache::Client.new(token: @token, project_id: @old_project_id)
@new_iron_cache = IronCache::Client.new(token: @token, project_id: @new_project_id)
@RichFromGalvanize
RichFromGalvanize / gist:5873044
Last active January 4, 2019 07:48
An image piping example using Node.js, express, and request...BOOYA!
var request = require('request');
var express = require('express');
var app = express();
app.get('/goofy', function(req, res) {
request('http://images1.wikia.nocookie.net/__cb20120715102950/disney/images/a/a5/Disneygoofy2012.jpeg').pipe(res);
});
app.get('/loop', function(req, res) {
res.render('mypage');