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
| # xcode-build-timestamp.sh | |
| # @desc Set a timestamp as the build number when the project is compiled. | |
| # @usage | |
| # 1. Select: your Target in Xcode | |
| # 2. Select: Build Phases Tab | |
| # 3. Select: Add Build Phase -> Add Run Script | |
| # 4. Paste code below in to new "Run Script" section | |
| # 5. Drag the "Run Script" below "Target dependencies" | |
| buildNumber=$(date +%Y%m%d%H%M) |
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
| // Copyright (C) 2013 Polychrom Pty Ltd | |
| // | |
| // This program is licensed under the 3-clause "Modified" BSD license, | |
| // see LICENSE file for full definition. | |
| package com.polychrom.examples; | |
| import java.util.concurrent.ExecutorService; | |
| import android.app.Activity; |
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
| // Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
| // jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
| // author: Pawel Kozlowski | |
| var myApp = angular.module('myApp', []); | |
| //service style, probably the simplest one | |
| myApp.service('helloWorldFromService', function() { | |
| this.sayHello = function() { | |
| return "Hello, World!" |
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
| # bash alias | |
| alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' | |
| # bash function, usage: $ st -p [projectname] -opt2 -opt3 | |
| function st() { | |
| if [ -n "$1" -a -n "$2" ]; then # if more than one argument | |
| if [ "$1" = "-p" -o "$1" = "--project" ]; then # if arg1 is -p or --project | |
| local projectfile="$2" | |
| [[ $projectfile != *.sublime-project ]] && projectfile="$2.sublime-project" # detect if arg2 already includes the ext | |
| if [ -e $projectfile ]; then # does project file exist? |
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
| <script src="jquery-1.6.1.min.js"></script> | |
| <script src="socket.io/socket.io.js"></script> | |
| <script> | |
| var socket = new io.Socket(null,{port:8080}); | |
| socket.connect(); | |
| socket.on('message',function(obj){ | |
| switch(obj.tipo){ | |
| case 'imagen': | |
| img = document.getElementById('stream'); | |
| img.src=""; |
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
| /* | |
| f = número de casas decimais | |
| d = separador de decimos (’,’ virgula por padrão) | |
| t = separador de milhar (’.’ ponto por padrão) | |
| */ | |
| String.prototype.currencyFormat = function (f, d, t) { | |
| var n = (n = this.match(/\d/g)) ? n.join('').replace(/^0+/,'') : '0', f = (f) ? f : 2, d = (d) ? d : ',', t = (t) ? t : '.'; | |
| if (n.length < f + 1) return '0' + d + ((n.length < f) ? new Array(f - n.length + 1).join('0') + n : n) | |
| else return n.substr(0, n.length - f).split('').reverse().join('').match(/\d{1,3}/g).join(t).split('').reverse().join('') + d + n.substr(n.length - f) |
NewerOlder