Skip to content

Instantly share code, notes, and snippets.

@laat
laat / tizen.sh
Last active March 9, 2024 11:06
Notes on Tizen commands that might work
sdb connect <ip>:<port> # connect to TV
sdb -s <deviceName> capability # get <installationPath>
# build
tizen cli-config "default.profiles.path=<profile_path>"
tizen build-web -out .buildResult -- <source-dir>
tizen package --type wgt --sign profileName -- <source-dir>/.buildResult # extract <package-file>
mv <package-file> .
rm -rf <source-dir>/.buildResult
@joakin
joakin / git-find-me-the-fucking-deleted-file.sh
Last active July 22, 2024 06:50
finding a deleted file in a git repository
# If you don't remember the exact path/name, search the log for deleted files
git log --diff-filter=D --summary | grep delete
# Find the file you want to get from the ouput, and use the path
# Find the commits that involved that path
git log --all -- some/path/to/deleted.file
# Bring the file back to life to the current repo (sha commit of parent of commit that deleted)
git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file
@mcvendrell
mcvendrell / index.js
Created January 12, 2015 08:17
Titanium: How to re-use the launch image in the app (TiDev.io): Alloy style
// Animated start. Comments for code here: http://www.tidev.io/2015/01/06/how-to-re-use-the-launch-image-in-the-app
var img = Ti.UI.createImageView({
// Get the launch image
image: (function getImage() {
if (OS_IOS) {
// Working around orientation-bug
if (Ti.Platform.osname === 'ipad' || Math.max(Ti.Platform.displayCaps.platformWidth, Ti.Platform.displayCaps.platformHeight) === 736) {
return 'Default-' + (Ti.Gesture.isPortrait() ? 'Portrait' : 'Landscape') + '.png';
} else {
return 'Default.png';
@FokkeZB
FokkeZB / Gruntfile.js
Created October 18, 2014 18:24
Example Gruntfile.js for The Ultimate Titanium CLI Toolchain at Connect.js
module.exports = function(grunt) {
grunt.initConfig({
settings: {
releaseNotes: grunt.option('notes') || 'CI build',
appName: 'Flashlight',
ppUuid: '0253600x-ac6d-35b6-b66d-dd25c4fd956f',
installrAppToken: '6xC0I8SdJA76kW3pqq7GFZLIyq6fBP4Z'
},
@MotiurRahman
MotiurRahman / app.js
Last active August 29, 2015 14:02
ListView Template
/*
If you want to design a custom row in a listView. And each row as like as your mind in this case template is very
effective.
*/
//test case
var win = Ti.UI.createWindow({
title : 'Multiple Templates',
@artanisdesign
artanisdesign / jshint_setup.md
Last active December 1, 2015 15:58
Install and setup JSHint Plugin in Titanium / Appcelerator Studio
@aaronksaunders
aaronksaunders / app_snippet.js
Last active July 11, 2020 14:07
One way to do bulk updates and deletes with Appcelerator Alloy Collections
// add all items to collection
Alloy.Collections.Fugitive.reset([{
"name" : "Jeff Haynie"
}, {
"name" : "Nolan Wright"
}, {
"name" : "Don Thorp"
}, {
"name" : "Marshall Culpepper"
}, {
@alanleard
alanleard / app.js
Last active July 19, 2016 13:21
Understanding how backgroundLeftCap and backgroundTopCap work in Titanium
//This is a demo to show how backgroundLeftCap and backgroundTopCap work on the Tianium platform by Appcelerator
//Paste this code in app.js (tested on iOS)
//Screenshot: http://screencast.com/t/txWQD3l2UBN
///////////////////////////////////////////////////////////////////////////////
//Just modify these variables to see how backgroundLeftCap and topCap will work
var topCap = 20;
var leftCap = 35;
var originalImageSize = {height:100, width:100}
@stevenbeeckman
stevenbeeckman / gist:4526166
Last active December 11, 2015 01:49
An example of how to call a JSON webservice directly from BlackBerry 10 Cascades QML. This gist also shows how to convert Date strings purely in QML. This gist is part of this blogpost: http://www.shadowmedia.be/bbdevbe/2013/01/13/listing-json-data-from-a-webservice-using-pure-qml/.
import bb.cascades 1.0
import bb.data 1.0 // don't forget to add "LIBS += -lbbdata" to your .pro file!
Page {
id: pgDetail
actions: [
ActionItem {
title: qsTr("Refresh")
onTriggered: {
@stuarteberg
stuarteberg / show-git-branch-in-bash-prompt
Last active October 10, 2021 17:55
Code for your .bashrc file. Show current git branch on bash shell prompt....with color! (This was copied and modified from similar code you can find out there on the 'tubes.)
# Colors for the prompt
blue="\033[0;34m"
white="\033[0;37m"
green="\033[0;32m"
# Brackets needed around non-printable characters in PS1
ps1_blue='\['"$blue"'\]'
ps1_green='\['"$green"'\]'
ps1_white='\['"$white"'\]'