This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export DISK=/dev/loop3 | |
| export DEST=/data/recov | |
| btrfs-find-root /dev/loop3 2>&1|grep seems|awk '{print $3}' > blocks | |
| for i in $(cat blocks); do mkdir -p $DEST/$i; btrfs restore -o -v -t $line $DISK $DEST/$i; done; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.directive 'ngInitial', -> | |
| restrict: 'A' | |
| controller: ['$scope', '$element', '$attrs', '$parse', ($scope, $element, $attrs, $parse) -> | |
| val = $attrs.sbInitial || $element.val() | |
| getter = $parse($attrs.ngModel) | |
| setter = getter.assign | |
| setter($scope, val) | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // based on http://jsfiddle.net/7eTMV/20/ | |
| // https://github.com/angular-ui/ui-sortable | |
| // https://github.com/johnny/jquery-sortable | |
| angular.module('ui.directives').directive('uiSortable', [ | |
| 'ui.config', function(uiConfig) { | |
| var options; | |
| options = {}; | |
| if (uiConfig.sortable != null) { | |
| angular.extend(options, uiConfig.sortable); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.factory('socket', function ($rootScope) { | |
| var socket = new WebSocket("ws://localhost:8000/data"); | |
| return { | |
| onopen: function (callback) { | |
| socket.onopen = function () { | |
| $rootScope.$apply(function () { | |
| callback.apply(socket); | |
| }); | |
| }; | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package harvest | |
| import ( | |
| _ "encoding/base64" | |
| _ "fmt" | |
| "net/http" | |
| "appengine" | |
| "appengine/runtime" | |
| _ "math" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package service | |
| import ( | |
| _ "encoding/base64" | |
| _ "fmt" | |
| _ "net/http" | |
| "appengine" | |
| "appengine/urlfetch" | |
| "appengine/runtime" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import transaction | |
| class ElasticSearchIndexManager(object): | |
| def __init__(self, callable, args, kwargs): | |
| self.callable = callable | |
| self.args = args | |
| self.kwargs = kwargs | |
| # Use the default thread transaction manager. | |
| self.transaction_manager = transaction.manager | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import traceback | |
| LOGGLY_URL = "https://logs-01.loggly.com/inputs/{{ LOGGLY_ID }}/tag/{{ TAG }}/" | |
| class LogglyHandler(logging.Handler): | |
| def emit(self, record): | |
| trace = None | |
| exc = record.__dict__['exc_info'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * | |
| * * | |
| * * | |
| * * | |
| * * | |
| * * | |
| * * | |
| * * | |
| * * | |
| * * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import logging | |
| from pyramid.response import Response | |
| from pyramid.view import view_config, view_defaults | |
| from sqlalchemy.sql.expression import and_, or_, not_ | |
| from sqlalchemy.orm.exc import NoResultFound | |
| from .models import ( |
OlderNewer