working on it ...

Filters

Explore Public Snippets

Sort by

Found 95k snippets matching: from

    public by angelangel04 modified Sep 22, 2014  744611  42  6  0

    Puzzle And Dragons Hack Cheats Tool Android iOS

    Download Puzzle And Dragons Hack Cheats Tool Android iOS From Below Link
    Puzzle And Dragons Hack tool cheats Android/iOS:
    
    DOWNLOAD -> http://bit.ly/puzzleanddragonshack
    
    
    DOWNLOAD -> http://bit.ly/puzzleanddragonshack
    
    
    DOWNLOAD -> http://bit.ly/puzzleanddragonshack
    
    
    
    
    Puzzle And Dragons Hack tool is finally out. We got hug number of requests to code a hack tool for this Puzzle And Dragons game. Accepting those requests our team has worked to code a Puzzle And Dragons Hack tool and finally got succeeded in it. This hack tool can add unlimited Coins and Magic Stones in the game. We have been beta testing this Puzzle And Dragons Hack tool for a week and achieved 95% success rate, that means it added Coins and Magic Stones to the game 19 times out of 20. This hack tool is compatible with Both Android and iOS phones. Root or Jailbreak is not required to use this hack.
    Our hack tool has a default Anti-ban script installed that ensures your safety while applying the hack. Proxy support gives an option to hide your ip and therefore making you stay anonymous.If you have any doubts on using this Puzzle And Dragons Hack tool you can refer to the guide that come with the hack tool. Or you can write to us by using Contact US option above or commenting below. Have fun playing this Puzzle And Dragons with unlimited Coins and Magic Stones.
    
     
    
    Puzzle And Dragons Hack tool Features:
    
    Unlimited Coins
    Unlimited Magic Stones
    Unlimited Mana
    No jailbreak needed
    100% safe and undetectable
    Easy to use
    
    Tags:
    puzzle and dragons hack
    puzzle and dragons hack android
    puzzle and dragons hack cydia
    puzzle and dragons hack no survey
    puzzle and dragons hack tool
    puzzle and dragons hack apk
    puzzle and dragons hack forum
    puzzle and dragons hack 6.5.2
    puzzle and dragons hack no download
    puzzle and dragons hack ios no survey
    puzzle and dragons hack android
    puzzle and dragons hack cydia
    puzzle and dragons hack no survey
    puzzle and dragons hack tool
    puzzle and dragons hack apk
    puzzle and dragons hack ios
    puzzle and dragons hack forum
    puzzle and dragons hack 6.5.2
    puzzle and dragons hack no download
    puzzle and dragons hack ios no survey
    puzzle and dragons hack android
    puzzle and dragons hack apk
    puzzle and dragons hack android no survey
    puzzle and dragons hack app
    puzzle and dragons hack android download
    puzzle and dragons hack android apk
    puzzle and dragons attack hack
    puzzle and dragons android hack 2014
    puzzle and dragons damage hack android
    puzzle and dragons hack tool android
    puzzle and dragons bin hack
    puzzle and dragons binary hack
    puzzle and dragons hack cheats tool 2013 by hmg
    puzzle and dragons ultimate hack ban
    puzzle and dragons hack cydia
    puzzle and dragons hack cheat tool
    puzzle and dragons hack cheat tool 2013
    puzzle and dragons hack cydia 2014
    puzzle and dragons hack cheats tool 2013 by hmg
    puzzle and dragons combo hack
    puzzle and dragons hack no computer
    puzzle and dragons hacks and cheats
    puzzle and dragons magic stone hack cydia
    can you hack puzzle and dragons
    puzzle and dragons hack download
    puzzle and dragons hack download no survey
    puzzle and dragons hack damage
    puzzle and dragons damage hack android
    puzzle and dragons hack tool download
    puzzle and dragons android hack download
    puzzle and dragons hack no download
    puzzle and dragons iphone hack download
    puzzle and dragons hack free download
    puzzles and dragons ultimate hack download
    puzzle and dragons hack exe
    puzzle and dragons english hack
    puzzle and dragons exp hack
    puzzle and dragons egg hack
    puzzle and dragons hack v1 .6.exe
    puzzle and dragons hack v1.6.exe no survey
    puzzle and dragons hack v2 .0.1.exe
    puzzle and dragons hack tool v3.20 exe
    puzzle and dragons ultimate evolution hack
    puzzle and dragons rare egg machine hack
    puzzle and dragons hack forum
    puzzle and dragons hack for android
    puzzle and dragons hack file
    puzzle and dragons hack free download
    puzzle and dragons hack for iphone
    puzzle and dragons hack for mac
    puzzle and dragons hack free
    puzzle and dragons hack fake
    puzzle and dragons hack for ipad
    puzzle and dragons hack free no survey
    puzzle and dragons gem hack
    puzzle and dragons gameplayer hack
    puzzle and dragons game hack
    puzzle and dragons hp hack
    puzzle and dragons health hack
    puzzle and dragons how to hack
    puzzle and dragons hack cheats tool 2013 by hmg
    how to download puzzle and dragons hack
    how to hack puzzle and dragons with ifile
    how to hack puzzle and dragons android
    how to hack puzzle and dragons with ifunbox
    how to hack puzzle and dragons no survey
    puzzle and dragons ultimate hack puzzle & dragons ultimate hack
    puzzle and dragons hack ios
    puzzle and dragons hack ios no survey
    puzzle and dragons hack ifile
    puzzle and dragons hack iphone no survey
    puzzle and dragons hack ipad
    puzzles and dragons hack ipod
    puzzle and dragons iap hack
    puzzle and dragons iphone hack download
    puzzle and dragons ipa hack
    puzzle and dragons magic stone hack iphone
    puzzle and dragons hack jailbreak
    puzzle and dragons hack japan
    puzzle and dragons hack japanese
    puzzle and dragons hack no jailbreak
    puzzle and dragons instant kill hack
    puzzle and dragons hack link
    puzzle and dragons level hack
    puzzle and dragons hack magic stones
    puzzle and dragons hack mac
    puzzle and dragons hack mod
    puzzle and dragons monster hack
    puzzle and dragons money hack
    puzzle and dragons hack tool mac
    puzzles and dragons hack no survey mac
    puzzles and dragons egg machine hack
    puzzle and dragons rare egg machine hack
    puzzle and dragons magic stone hack no survey
    puzzle and dragons hack no survey
    puzzle and dragons hack no jailbreak
    puzzle and dragons hack no download
    puzzle and dragons hack no survey 2014
    puzzle and dragons hack no computer
    puzzle and dragons hack no pc
    puzzles and dragons hack no survey mac
    puzzles and dragons hack no survey android
    puzzle and dragons hack iphone no survey
    free puzzle and dragons hack no survey
    puzzle and dragons hack online
    puzzle and dragons hack on iphone
    puzzle and dragons orb hack
    how to hack puzzle and dragons on android
    how to hack on puzzle and dragons
    puzzle and dragons hack password
    puzzles and dragons hack program
    puzzle and dragons hack tool password
    puzzle and dragons hack no pc
    puzzle and dragons hack tool v1.03 password
    puzzle and dragons pal points hack
    puzzles and dragons hack tool.zip password
    puzzle and dragons hack no survey no password
    puzzle and dragons hack tool v1.03.zip password
    password for puzzle and dragons hack tool v1.03.txt
    puzzle and dragons hack reddit
    puzzle and dragons hack rar
    puzzle and dragons hack review
    puzzle and dragons hack real
    puzzle and dragons hack root
    puzzle and dragons reroll hack
    puzzle and dragons gem hack
    puzzle and dragons hack tool.rar
    puzzle and dragons android root hack
    puzzles and dragons hack tool v1 .1.rar
    puzzle and dragons hack sinful
    puzzle and dragons hack sinfuliphone
    puzzle and dragons hack stones
    puzzle and dragons hack stamina
    puzzle and dragons stat hack
    puzzle and dragons hack no survey
    puzzle and dragons hack magic stones
    puzzle and dragons hack no survey no password
    puzzles and dragons hack no survey mac
    puzzles and dragons hack no survey android
    puzzle and dragons hack tool
    puzzle and dragons hack tool no survey
    puzzle and dragons hack tool without survey
    puzzle and dragons hack tool password
    puzzle and dragons hack tool download no survey
    puzzle and dragons hack tool v1.03 password
    puzzle and dragons hack tool download
    puzzle and dragons hack tool v1.03
    puzzle and dragons hack tool 2014
    puzzle and dragons hack tool v3.20 exe
    puzzle and dragons ultimate hack
    puzzle and dragons ultimate hack download
    puzzle and dragons ultimate hack zip
    puzzle and dragons ultimate hack rar
    puzzle and dragons ultimate hack ban
    puzzle and dragons ultimate hack dl
    puzzle and dragons ultimate hack v1.2
    puzzle and dragons ultimate hack android
    puzzle and dragons ultimate hack mac
    puzzle and dragons ultimate hack 知恵袋
    puzzle and dragons hack without survey
    puzzle and dragons hack with jailbreak
    puzzle and dragons working hack
    does puzzle and dragons hack work
    puzzle and dragons hack tool without survey
    do puzzle and dragons hacks work
    puzzle and dragons magic stone hack without survey
    how to hack puzzle and dragons with ifile
    how to hack puzzle and dragons with ifunbox
    world hack puzzle and dragons
    can you hack puzzle and dragons
    puzzles and dragons hack tool v1 .1.rar
    puzzles and dragons hack tool 1.2
    puzzles and dragons hack tool v1 .1
    puzzle and dragons ultimate hack 1.2
    puzzle & dragons hack 1.2
    puzzle and dragons cheats
    puzzle and dragons cheats android
    puzzle and dragons cheats ipad
    puzzle and dragons cheats cydia
    puzzle and dragons cheats 2014
    puzzle and dragons cheats no pc
    puzzle and dragons cheats no survey
    puzzle and dragons cheats ios
    puzzle and dragons cheats tool v1.1
    puzzle and dragons cheats mac
    puzzle and dragons cheats android
    puzzle and dragons cheats ipad
    puzzle and dragons cheats cydia
    puzzle and dragons cheats 2014
    puzzle and dragons cheats no pc
    puzzle and dragons cheats no survey
    puzzle and dragons cheats ios
    puzzle and dragons cheats tool v1.1
    puzzle and dragons cheats mac
    puzzle and dragons cheats tool 2013 by hmg
    puzzle and dragons cheats android
    puzzle and dragons cheats android no survey
    puzzle and dragons cheats apk
    puzzle and dragons cheat app
    puzzle and dragons cheat android download
    puzzle and dragons cheats and hacks
    puzzle and dragons hack tool and cheats
    puzzle and dragons cheats tool 2013 by hmg.rar
    puzzle and dragons cheats tool 2013 by hmg
    puzzle and dragons cheats cydia
    puzzle and dragons cheat codes
    puzzle and dragons combo cheat
    puzzle and dragons cheats tool unlock code. text
    puzzle and dragons cheats download
    puzzle and dragons damage cheat
    puzzle and dragons cheat free download
    puzzle and dragons cheat tool download
    puzzle and dragons cheat android download
    puzzle dragons cheat hack download
    puzzle and dragons cheat engine
    puzzle and dragons cheat engine android
    puzzle and dragons english cheats
    puzzle and dragons rare egg glitch
    puzzle and dragons cheats for android
    puzzle and dragons cheats for iphone
    puzzle and dragons cheats free
    puzzle and dragons cheats for ipod
    puzzle and dragons cheats forum
    puzzle and dragons cheat free download
    puzzle and dragons cheat free no survey
    puzzle and dragons gem cheat
    puzzles and dragons game cheats
    puzzles and dragons gem glitch
    puzzle and dragons hack cheats tool 2013 by hmg
    puzzle and dragons hack cheat tool
    puzzle and dragons hack cheat tool 2013
    puzzle and dragons cheats and hacks
    puzzle and dragons cheats tool 2013 by hmg.rar
    puzzles & dragons cheat engine hack
    how to download puzzle and dragons cheats
    puzzle dragons cheat hack download
    puzzle and dragons cheats iphone
    puzzle and dragons cheats ipad
    puzzle and dragons cheats ipod
    puzzle and dragons cheats ifile
    puzzle and dragons cheats iphone no survey
    puzzles and dragons cheats jailbreak
    puzzles and dragons cheats no jailbreak
    puzzle and dragons japan cheat
    puzzle and dragons cheats mac
    puzzle and dragons cheat magic stone
    puzzles and dragons money cheat
    puzzles and dragons rare egg machine cheat
    puzzle and dragons cheats no pc
    puzzle and dragons cheats no survey
    puzzles and dragons cheats no jailbreak
    puzzle and dragons cheats android no survey
    puzzle and dragons cheats iphone no survey
    puzzle and dragons cheat tool no survey
    puzzle and dragons cheat free no survey
    puzzle and dragons orb cheat
    cheats on puzzle and dragons
    puzzle and dragons cheats password
    puzzle and dragons cheats no pc
    puzzle and dragons cheat tool password
    puzzles and dragons cheats without pc
    puzzle and dragons pal points cheat
    puzzles and dragons cheats review
    puzzle and dragons cheats tool 2013.rar
    puzzle and dragons cheats tool 2013 by hmg.rar
    puzzle and dragons stamina cheat
    puzzle and dragons screenshot cheat
    puzzle and dragons cheats no survey
    puzzle and dragons cheats without survey
    puzzle and dragons stamina glitch
    puzzle and dragons cheat magic stone
    puzzle and dragons cheats android no survey
    puzzle and dragons cheats iphone no survey
    puzzle and dragons cheat tool no survey
    puzzle and dragons cheat free no survey
    puzzle and dragons cheats tool v1.1
    puzzle and dragons cheats tool 2013 by hmg
    puzzle and dragons cheats tool 2013 by hmg.rar
    puzzle and dragons cheats tool
    puzzle and dragons cheats tool 2013
    puzzle and dragons cheats tool zip
    puzzle and dragons cheats tool unlock code. text
    puzzle and dragons cheats tool 2013.rar
    puzzle and dragons cheat tool no survey
    puzzle and dragons cheat tool password
    puzzle and dragons cheats tool unlock code. text
    puzzle and dragons cheat v7.0.3
    puzzle and dragons cheats without survey
    puzzles and dragons cheats without pc
    
    

    public by fabio.nosenzo @ Amazon_AWS_Python_API modified Aug 1, 2013  588096  5  8  -1

    Amazon S3 Aws - S3Connection object from python boto API

    This snippet is about the S3Connection object provided by python boto package for Amazon AWS API. Here the __init__ method is listed with all its variables. The AWSAuthConnection object is initialized and it handles all the data for managing requests and response from Amazon AWS service. Path: [boto/s3/connection.py] Learn more about S3Con
    import boto.utils
    from boto.connection import AWSAuthConnection
    
    class S3Connection(AWSAuthConnection):
        DefaultHost = boto.config.get('s3', 'host', 's3.amazonaws.com')
        DefaultCallingFormat = boto.config.get('s3', 'calling_format', 'boto.s3.connection.SubdomainCallingFormat')
        QueryString = 'Signature=%s&Expires=%d&AWSAccessKeyId=%s'
    
        def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
                     is_secure=True, port=None, proxy=None, proxy_port=None,
                     proxy_user=None, proxy_pass=None,
                     host=DefaultHost, debug=0, https_connection_factory=None,
                     calling_format=DefaultCallingFormat, path='/',
                     provider='aws', bucket_class=Bucket, security_token=None,
                     suppress_consec_slashes=True, anon=False,
                     validate_certs=None):
            if isinstance(calling_format, str):
                calling_format=boto.utils.find_class(calling_format)()
            self.calling_format = calling_format
            self.bucket_class = bucket_class
            self.anon = anon
            AWSAuthConnection.__init__(self, host,
                    aws_access_key_id, aws_secret_access_key,
                    is_secure, port, proxy, proxy_port, proxy_user, proxy_pass,
                    debug=debug, https_connection_factory=https_connection_factory,
                    path=path, provider=provider, security_token=security_token,
                    suppress_consec_slashes=suppress_consec_slashes,
                    validate_certs=validate_certs)

    public by antlong modified Aug 10, 2015  489171  15  7  1

    Extract JPG images from a PDF

    A command line tool to extract jpg images from pdf files.
    #!/usr/bin/env python
    import sys
    
    
    def main():
        """Extract JPG's from PSD's.
        
        Usage:
          python extract.py filename.pdf
        
        Note:
          All extracted images will be saved to the directory 
          the script is initialized in.
        """
        try:
            pdf = file(sys.argv[1], "rb").read()
        except Exception:
            print "Usage: `python extract.py filename.pdf`"
            return
    
        startmark, endmark = "\xff\xd8", "\xff\xd9"
        startfix, endfix, i, njpg = 0, 2, 0, 0
    
        while True:
            istream = pdf.find("stream", i)
            if istream < 0:
                break
            istart = pdf.find(startmark, istream, istream+20)
            if istart < 0:
                i = istream+20
                continue
            iend = pdf.find("endstream", istart)
            if iend < 0:
                raise Exception("Couldn't find end of stream.")
            iend = pdf.find(endmark, iend-20)
            if iend < 0:
                raise Exception("Couldn't find end of JPG.")
         
            istart += startfix
            iend += endfix
            jpg = pdf[istart:iend]
            with open("jpg%d.jpg" % njpg, "wb") as _f:
                _f.write(jpg)
            njpg += 1
            i = iend
    
        print "Extracted %s JPG files." % njpg
    
    main()
    

    public by Justin P modified Mar 2, 2016  407947  14  3  0

    How to setup notifications FROM Sonarr INTO Slack!!

    How to setup notifications FROM Sonarr INTO Slack!!: Sonarr-SlackNotifications
    Grab the URL for Incoming WebHooks from Slack:
    
      https://my.slack.com/services/new/incoming-webhook/
    
    After you complete that step, it looks a little like this:
    
      https://hooks.slack.com/TXXXXX/BXXXXX/XXXXXXXXXX
    
    Next create a new bash script with this code:
    
      #!/bin/bash
      curl -X POST --data-urlencode "payload={\"username\": \"Sonarr\", \"icon_emoji\": \":ghost:\", \"text\": \"$sonarr_eventtype: $sonarr_series_title S$sonarr_episodefile_seasonnumber E$sonarr_episodefile_episodenumbers ($sonarr_episodefile_quality)\"}" $1
      
    I personally have mine on the same drive as my Download Directories, so its all in one place - I use OS X FYI.
    
      /Volumes/Downloader/sonarr/scripts/slack.sh
      
    Now set the permissions so it can be executed by everyone, you can modify this if you know what user Sonarr runs under on your system.
    
      sudo chmod a+x ~/scripts/sonarr/slack.sh
      
    Now, go into Sonarr, Settings, "Connect" or the notifications page, and select "Custom Script"
    
    In the Text Fields:
    
      Name: <Name your notification>
      Path: <put full path to slack.sh here>
      Arguments: <put your Slack Webhook URL here>
      
    as in:
    
      Name: Slack
      Path: /Volumes/Downloader/slack/scripts/slack.sh
      Arguments: https://hooks.slack.com/TXXXXX/BXXXXX/XXXXXXXXXX
      
    Copied and edited liberally from <https://github.com/Sonarr/Sonarr/wiki/Sonarr-notifications-in-Slack-using-curl>
    
    

    public by Derek Pauley modified Sep 29, 2015  381571  18  3  1

    SVNKit export from Subversion example

    SVNKit export from Subversion example: SvnExportExample.java
    import java.io.File;
    
    import org.tmatesoft.svn.core.SVNDepth;
    import org.tmatesoft.svn.core.SVNException;
    import org.tmatesoft.svn.core.SVNURL;
    import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
    import org.tmatesoft.svn.core.io.SVNRepository;
    import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
    import org.tmatesoft.svn.core.wc.SVNClientManager;
    import org.tmatesoft.svn.core.wc.SVNRevision;
    import org.tmatesoft.svn.core.wc.SVNUpdateClient;
    import org.tmatesoft.svn.core.wc.SVNWCUtil;
    
    
    public class SvnExportExample {
    
    	public static void main(String... args){
    		final String url = "svn://cavcops01.global.local/skunkworks";
    		final String destPath = "c:/temp/svntest";
    		
    		SVNRepository repository = null;
    		
    		try{
    			//initiate the reporitory from the url
    			repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));
    			//create authentication data
    			ISVNAuthenticationManager authManager = 
    					SVNWCUtil.createDefaultAuthenticationManager("cliff.darling", "svnuser");
    			repository.setAuthenticationManager(authManager);
    			//output some data to verify connection
    			System.out.println( "Repository Root: " + repository.getRepositoryRoot( true ) );
    			System.out.println(  "Repository UUID: " + repository.getRepositoryUUID( true ) );
    			//need to identify latest revision
    			long latestRevision = repository.getLatestRevision();
    			System.out.println(  "Repository Latest Revision: " + latestRevision);
    			
    			//create client manager and set authentication
    			SVNClientManager ourClientManager = SVNClientManager.newInstance();
    			ourClientManager.setAuthenticationManager(authManager);
    			//use SVNUpdateClient to do the export
    			SVNUpdateClient updateClient = ourClientManager.getUpdateClient( );
    			updateClient.setIgnoreExternals( false );
    			updateClient.doExport( repository.getLocation(), new File(destPath), 
    					SVNRevision.create(latestRevision), SVNRevision.create(latestRevision), 
    					null, true, SVNDepth.INFINITY);
    			
    		} catch (SVNException e) {
    			e.printStackTrace();
    		}finally {
    			System.out.println("Done");
    		}
    	}
    }
    
    
    

    public by lbottaro @ Amazon_AWS_Python_API modified Aug 1, 2013  304353  0  8  0

    Amazon S3 Aws - How to download a file from a bucket to a target directory

    This code shows how to download a file from an existing bucket invoking the boto python API, saving to a target directory. You need to specify the filename and path where to save the data. [How to create a bucket](http://www.snip2code.com/Snippet/4892/Amazon-Aws-S3---Creating-a-bucket-in-pyt) [How to upload a file to a bucket](http://www.sn
    # This downloads the object foobar.pdf and saves it in /home/luca/documents/
    
    key = bucket.get_key('foobar.pdf')
    key.get_contents_to_filename('/home/luca/documents/foobar.pdf')

    public by mirage3d modified Mar 16, 2016  289794  9  4  0

    Get localised country list from Cocoa in Swift

    import Cocoa
    
    let currentLocale = NSLocale.currentLocale()
    let countryCodes = NSLocale.ISOCountryCodes()
    let countryNames = countryCodes.map { currentLocale.displayNameForKey(NSLocaleCountryCode, value: $0) }
    	.filter { $0 != nil }
    	.sort(<)

    public by cghersi modified Nov 4, 2014  283390  2  6  1

    Remove HTML tags from text

    Removes the given tag (and all its content) from the specified text.
    static public string RemoveHtmlTag(string pageString, string tagName)
    {
      string output = pageString;
      int exprIni = 0;
      int firstChar = 0;
      int lastChar = 0;
    
      // find html element
      exprIni = output.IndexOf("<" + tagName, 0, output.Length,
                                      StringComparison.InvariantCultureIgnoreCase);
      while (exprIni >= 0)
      {
        // extract the html
        firstChar = exprIni;
    
        // find <tag ... />
        lastChar = output.IndexOf("/>", (firstChar + 1)) + 1;
        int nextCloseTag = output.IndexOf('>', (firstChar + 1));
    
        // closed with </tag> marker..
        if ((lastChar <= 0) || (nextCloseTag < lastChar))
        {
          // find </tag>
          lastChar = output.IndexOf("</" + tagName, (firstChar + 1), (output.Length - firstChar - 1),
                                                          StringComparison.InvariantCultureIgnoreCase);
          lastChar = output.IndexOf('>', (lastChar + 1));
        }
    
        if ((firstChar < 0) || (lastChar <= 0) || (firstChar == lastChar))
          return output.Substring(0, firstChar);
        else
        {
          output = String.Format("{0} {1}",
                      output.Substring(0, firstChar).Trim(),
                      output.Substring((lastChar + 1), (output.Length - lastChar - 1)).Trim());
        }
        exprIni = output.IndexOf("<" + tagName, 0, output.Length,
                                    StringComparison.InvariantCultureIgnoreCase);
      }
    
      return output;
    }
    

    public by HeathDernovich modified Aug 19, 2014  261993  0  4  1

    An example of inheriting from event emitter

    An example of inheriting from event emitter: EventEmitterPattern.js
    // Require our emitter
    
    var Emitter = require('events').EventEmitter;
    
    // Our main constructor
    
    var myEmitter = function (config) {
      // extend with emitter
      Emitter.call(this);
      };
      // Inherit from emitter, but keep my constructor
      
      myEmitter.prototype = Object.create(Emitter.prototype, {
        constructor: {
          value: myEmitter
        }
      });
      
      // methods
      
    myEmitter.prototype.setName = function (nam) {
      this.name = nam;
      this.emit('nameChanged', name);
     };
     
    module.exports = myEmitter;
    
    

    public by ejmurray modified Jan 22, 2016  249941  16  3  0

    Photo management script. This script will copy photos from "~/Pictures/iPhone Incoming" into a tree the script creates, with folders representing month and years, and photo names timestamped. Completely based on the work of the amazing Dr. Drang; se...

    Photo management script. This script will copy photos from "~/Pictures/iPhone Incoming" into a tree the script creates, with folders representing month and years, and photo names timestamped. Completely based on the work of the amazing Dr. Drang; see here: http://www.leancrew.com/all-this/2013/10/photo-management-via-the-finder/ You can see mor
    #!/usr/bin/python
    
    import sys
    import os, shutil
    import subprocess
    import os.path
    from datetime import datetime
    
    ######################## Functions #########################
    
    def photoDate(f):
      "Return the date/time on which the given photo was taken."
    
      cDate = subprocess.check_output(['sips', '-g', 'creation', f])
      cDate = cDate.split('\n')[1].lstrip().split(': ')[1]
      return datetime.strptime(cDate, "%Y:%m:%d %H:%M:%S")
    
    
    ###################### Main program ########################
    
    # Where the photos are and where they're going.
    sourceDir = os.environ['HOME'] + '/Pictures/iPhone Incoming'
    destDir = os.environ['HOME'] + '/Pictures/iPhone'
    errorDir = destDir + '/Unsorted/'
    
    # The format for the new file names.
    fmt = "%Y-%m-%d %H-%M-%S"
    
    # The problem files.
    problems = []
    
    # Get all the JPEGs in the source folder.
    photos = os.listdir(sourceDir)
    photos = [ x for x in photos if x[-4:] == '.jpg' or x[-4:] == '.JPG' ]
    
    # Prepare to output as processing occurs
    lastMonth = 0
    lastYear = 0
    
    # Create the destination folder if necessary
    if not os.path.exists(destDir):
      os.makedirs(destDir)
    if not os.path.exists(errorDir):
      os.makedirs(errorDir)
    
    # Copy photos into year and month subfolders. Name the copies according to
    # their timestamps. If more than one photo has the same timestamp, add
    # suffixes 'a', 'b', etc. to the names. 
    for photo in photos:
      # print "Processing %s..." % photo
      original = sourceDir + '/' + photo
      suffix = 'a'
      try:
        pDate = photoDate(original)
        yr = pDate.year
        mo = pDate.month
    
        if not lastYear == yr or not lastMonth == mo:
          sys.stdout.write('\nProcessing %04d-%02d...' % (yr, mo))
          lastMonth = mo
          lastYear = yr
        else:
          sys.stdout.write('.')
        
        newname = pDate.strftime(fmt)
        thisDestDir = destDir + '/%04d/%02d' % (yr, mo)
        if not os.path.exists(thisDestDir):
          os.makedirs(thisDestDir)
    
        duplicate = thisDestDir + '/%s.jpg' % (newname)
        while os.path.exists(duplicate):
          newname = pDate.strftime(fmt) + suffix
          duplicate = destDir + '/%04d/%02d/%s.jpg' % (yr, mo, newname)
          suffix = chr(ord(suffix) + 1)
        shutil.copy2(original, duplicate)
      except Exception:
        shutil.copy2(original, errorDir + photo)
        problems.append(photo)
      except:
        sys.exit("Execution stopped.")
    
    # Report the problem files, if any.
    if len(problems) > 0:
      print "\nProblem files:"
      print "\n".join(problems)
      print "These can be found in: %s" % errorDir
    
    
    
    • Public Snippets
    • Channels Snippets