Skip to content

Instantly share code, notes, and snippets.

@gleicon
gleicon / list_objects_google_storage_boto3.py
Last active October 11, 2023 14:27
How to use boto3 with google cloud storage and python to emulate s3 access.
from boto3.session import Session
from botocore.client import Config
from botocore.handlers import set_list_objects_encoding_type_url
import boto3
ACCESS_KEY = "xx"
SECRET_KEY = "yy"
boto3.set_stream_logger('')
@hexerei
hexerei / index.html
Created May 26, 2017 10:16
Liquid number format with thousands and decimal seperator
<h1>Usage Template</h1>
<h2>With integer to decimal conversion</h2>
<p>
{% include numf.html number=12345 %} <!-- output is 12.345,00 --><br />
{% include numf.html number=12345 decimals=0 %} <!-- output is 12.345 --><br />
{% include numf.html number=12345 decimals=4 %} <!-- output is 12.345.0000 --><br />
{% include numf.html number=12345 ds='.' ts=',' %} <!-- output is 12,345.00 --><br />
</p>
@oglops
oglops / yaml_OrderedDict.py
Last active January 25, 2023 11:08
write to and load from yaml file with OrderedDict
#!/usr/bin/env python
try:
# for python newer than 2.7
from collections import OrderedDict
except ImportError:
# use backport from pypi
from ordereddict import OrderedDict
import yaml
@iwarner
iwarner / Checkout
Last active October 16, 2023 06:51
Simple Cart Stripe Installation
/**
* Stripe
*
* @param object opts Options Object
* @see https://support.stripe.com/questions/which-currencies-does-stripe-support
* @todo Make functions variables in this
*/
Stripe : function ( opts )
{
@iStefo
iStefo / ember-meta.js
Created April 29, 2013 13:14
Ember-Meta module. See first comment for usage etc.!
// include this code in your application, you don't need to call any initialization manually!
Ember.Application.initializer({
name: "meta",
initialize: function(container, application) {
// helper function to get tag from dom
var _getTag = function(tagname, property, value) {
var tags = document.head.getElementsByTagName(tagname),
tag,
@gereon
gereon / gist:3150445
Created July 20, 2012 12:20
Mac OSX Spotlight Enhancement

Mac OSX Spotlight Enhancement

Add this to Info.plist in /System/Library/Spotlight/RichText.mdimporter/Contents/ and Spotlight will search for source code files.

<string>public.c-header</string>
<string>public.c-plus-plus-header</string>
<string>public.c-source</string>
<string>public.objective-c-source</string>
public.c-plus-plus-source
@140bytes
140bytes / LICENSE.txt
Created May 9, 2011 16:13
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE