Skip to content

Instantly share code, notes, and snippets.

View umeboshi2's full-sized avatar
💭
Ztd

Joseph Rawson umeboshi2

💭
Ztd
View GitHub Profile
@simonw
simonw / is_hard.py
Created November 8, 2009 09:06
Python script for telling if two files are hard links to the same thing
#!/usr/bin/env python
"is_hard.py - tell if two files are hard links to the same thing"
import os, sys, stat
def is_hard_link(filename, other):
s1 = os.stat(filename)
s2 = os.stat(other)
return (s1[stat.ST_INO], s1[stat.ST_DEV]) == \
(s2[stat.ST_INO], s2[stat.ST_DEV])
@DmitrySoshnikov
DmitrySoshnikov / python-closures.py
Created November 15, 2010 12:03
Understanding Python's closures
# "Understanding Python's closures".
#
# Tested in Python 3.1.2
#
# General points:
#
# 1. Closured lexical environments are stored
# in the property __closure__ of a function
#
# 2. If a function does not use free variables
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
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
@Aissen
Aissen / gist:2925633
Created June 13, 2012 18:20
Linux users: watch out for last-gen Intel Atom

Linux users: watch out for last-gen Intel Atom

Oops. They did it again.

It hit the market during the last few weeks. Last generation of Intel Atoms: CedarView (D2300, D2500, D2550, D2600, D2700) and Cedar Trail (N2600, N2700, N2800) SoCs integrate a PowerVR GPU from Imagination instead of the usual Intel GPU. If you remember the Poulsbo fiasco, it's the same. More or less.

An unsupported graphic card on Linux distributions, and which can't properly support a basic desktop environnment like Unity or Gnome 3.

To prevent this issue, Intel woke up MeeGo from the dead in last february [to add support for CedarView]

@danfinlay
danfinlay / How to download streaming video.md
Last active March 23, 2024 03:32
How to download a streaming video with Google Chrome

How to download streaming video

Streaming just means a download that they don't want you to keep. But Chrome's developer tools make it easy to access what's really going on under the hood.

Open Developer Tools

From the page where you want to download some things, go into your chrome menu to open the developer tools. You can either:

1.  (On a mac): Command-option-J
2. (On a PC): Control-alt-J
@leoasis
leoasis / marionette_rivets.js
Last active March 7, 2019 16:00
React vs Marionette + Rivets
var List = Backbone.Marionette.CollectionView.extend({
itemView: Item,
tagName: 'ul'
});
var Item = Backbone.Marionette.ItemView.extend({
tagName: 'li',
template: function(data) {
return '<span rv-text="model.name"></span><p rv-text="model.description"><p>';
},
@adilapapaya
adilapapaya / README
Last active June 27, 2020 11:58
Export Table Data to CSV using Javascript
Example code for exporting data in a table to a csv file.
@BinaryMuse
BinaryMuse / README.md
Last active February 1, 2017 00:51
Integrating React with Marionette

Integrating React with Marionette

See ReactComponentView and BackboneModelWatchMixin, below.

Notes

The BackboneModelWatchView could use some additional methods to allow adding/removing watched models after the component is created.

@tbonza2
tbonza2 / gist:20757551443a61254aa6
Last active November 4, 2016 21:39
Saltstack mode for emacs

Saltstack mode for emacs

Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the question on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text implementation appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.

Reasoning

After looking around, I found that someone had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use Mako templates for a project not involving Saltstack. Since Edx uses Mako t

#!/bin/bash
#
# Search $1 path (default to /) for files with over $2 (defaults to 100) fragments and attempts to defragment them.
#
# Author: Kyle Manna
#
root=${1:-/}
min=${2:-100}