IMPORTANT!

Snipt is going open source. We've toyed with this idea for quite a while, and have finally decided it's the right way to move forward.

A few things:
  • The entire Snipt source code will be released on GitHub under the 3-clause BSD License on Friday, September 10th.
  • While we'd like to think we're perfect, we realize we're only human. By open sourcing the software that runs this website, certain bugs or security flaws may be discovered that could compromise the privacy of your snipts.
  • Only the Lion Burger team will be able to push commits to the Snipt.net site. Contributors should send a pull request to add new features or submit patches.
  • By using this site, you agree not to be too angry or take any legal action against Lion Burger should this whole thing go up in flames some day.
  • Follow us on Twitter for updates.
I agree, close this message
Sign up to create your own snipts, or login.

Latest 100 public snipts » clevercss The latest public clevercss snipts.

showing 1-2 of 2 snipts for clevercss
  • script exemplo de utilização do clevercss
    # retirado de http://sandbox.pocoo.org/clevercss/
    import clevercss
    print clevercss.convert('''
    body:
      background-color: $background_color
    ''', {'background_color: 'red.darken(10)'})
    

    copy | embed

    0 comments - tagged in  posted by italomaia on Feb 17, 2010 at 1:52 p.m. EST
  • css2clever translator. Simple and functional.
    #!/usr/bin/python
    # -*- coding:utf-8 -*-
    
    #--------------------------------------
    #
    # data: 30/11/2009
    # author: italo moreira campelo maia
    # http://italomaia.com
    # http://eusouolobomau.blogspot.com/
    #
    #--------------------------------------
    
    import os, sys, time
    import clevercss as clever
    
    def parse(filepath):
        if filepath.endswith(".clever"):
            with open(filepath) as file:
                data = file.read()
                return clever.convert(data)        
    
    def write(filename, data):
        with open(filename, 'w') as file:
            file.write(data)
    
    def write_clever(cfile, verb=False):
        data = parse(cfile)
        if verb:
            print "CLEVER FILE: ", cfile
            print "------------------------------------------"
            print ""
            print data
            print ""
        write("%s.css" % cfile[:-7], data)
        print ("%s.css criado." % cfile[:-7])
    
    def print_help():
        print "USAGE:"
        print "clever2css -c *.clever - cria"
        print "clever2css -c arquivo.clever - cria"
        print "clever2css -w *.clever - cria e observa por atualizações"
        print "clever2css -w arquivo.clever - cria e observa por atualizações"
        print "clever2css -q *.clever - modo simples"
        print "clever2css -q arquivo.clever - modo simples"
        print "clever2css -p *.clever - modo verborrágico"
        print "clever2css -p arquivo.clever - modo verborrágico"
        print "clever2css -q -p -c *.clever"
        print "clever2css -q -p -c arquivo.clever"
        
    
    def main(args):
        LIST=True
        WATCH=False
        CREATE=False
        PRINT=False
    
        if "-h" in args:
            print_help()
            exit(0)
    
        # quiet
        if "-q" in args:
            args.pop(args.index("-q"))
            LIST=False
    
        # create
        if "-c" in args:
            args.pop(args.index("-c"))
            CREATE=True
        
        if "-w" in args:
            args.pop(args.index("-w"))
            WATCH=True
    
        # print
        if "-p" in args:
            args.pop(args.index("-p"))
            PRINT=True
        
        if args:
            if LIST:
                print ""
                print "PROCESSANDO:"
                for arg in args: print "- %s" % arg
                print ""        
            
            if any([WATCH, CREATE]):
                if WATCH:
                    tdict = {}
                    while True:
                        for arg in args:
                            ftime = os.path.getmtime(arg)
                            
                            if tdict.get(arg, False)!=ftime:
                                tdict[arg]=ftime
                                write_clever(arg, PRINT)
                            time.sleep(0.5)
                elif CREATE:
                    for arg in args:
                        write_clever(arg, PRINT)
        else: print "Nada a fazer."
    
    if __name__=="__main__":
        main(sys.argv[1:])
    

    copy | embed

    0 comments - tagged in  posted by italomaia on Dec 11, 2009 at 11:39 a.m. EST
Sign up to create your own snipts, or login.