Skip to content

Instantly share code, notes, and snippets.

View davidcyp's full-sized avatar

davidcyp davidcyp

View GitHub Profile
@GuiSim
GuiSim / Traktor Kontrol S4 MIDI input port 0.djayMidiMapping
Created June 12, 2017 07:51
Traktor S4 configuration file for DJay Pro
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>controls</key>
<array>
<dict>
<key>controlType</key>
<string>button</string>
<key>keyPath</key>
@m-x-k
m-x-k / pipelineChooseDockerTags.groovy
Created November 16, 2016 22:05
Jenkins pipeline - choose docker tags
/*
* Displays input dropdown select containing docker image tags
* Manage Jenkins->Script Approval (required)
*/
node {
stage('chooseDockerTags') {
def image = "IMAGE"
def url = "https://LOCAL-DOCKER-REG:5000/v2/${image}/tags/list"
def list = getDockerImageTags(url)
@grantges
grantges / Readme.md
Last active October 31, 2020 20:13
Shapes With Appcelerator Titanium and Hyperloop

Custom Alloy Tags based on Appcelerator Hyperloop modules

With Alloy and Hyperloop, you can quickly and easily expose native UI as Custom Alloy tags by leveraging the namespace (ns) attribute and commonjs modules.

Alloy allows you to create your own UI element that can be included into the XML View heirarchy in one of two ways, an Alloy Widget or through the use of Custom Tags.

To create your own custom tag, you link the tag to the commonjs module with the namespace attribute (ns). Here is an example using a custom tag to render a standard Titanium View:

@thomasdarimont
thomasdarimont / App.java
Last active July 10, 2023 12:19
How to use custom SpEL functions in @value with Spring Boot
package demo;
import static java.lang.reflect.Modifier.*;
import java.util.Arrays;
import java.util.Set;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanExpressionResolver;
@bzitzow
bzitzow / gist:9056b9147698f171eb2d
Created May 23, 2014 22:26
Phonegap SQLite Database Schema Migrations
//phoneGap HTML5 SQLite database schema migration example
var db = null;
var current_migration = null;
var current_schema_version = null;
// keep migration version order
var db_migrations = {
v1: {
version: "1.0",
up: function(tx) {
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@yeco
yeco / restapi.js
Last active April 27, 2017 11:18
Rest API Adapter for Titanium Alloy
/**
* Rest API Adapter for Titanium Alloy
*/
function S4() {
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
}
function guid() {
return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
@pietromalerba
pietromalerba / Titanium-Record-Video
Last active March 8, 2017 14:17
Titanium Record Video snippet
var btnCamera = Ti.UI.createButton({
title: 'Record',
top: 500,
left: 910,
width: 100,
height: 100,
borderColor: "#FFF",
borderRadius: 50,
borderWidth: 3,
backgroundImage: 'none',
@FokkeZB
FokkeZB / ALERT.md
Created May 3, 2013 11:06
Replacement for Titanium's alert()

I guess just like me you like to do alert('My message'); instead of:

Ti.UI.createAlertDialog({
        message: 'My message'
}).show();

But I'd even more like to do alert('My message', 'My title', myCallback); instead of:

@FokkeZB
FokkeZB / CROP.md
Created May 2, 2013 09:43
Image (cropping) CommonJS lib for Titanium

Often I need to display a user-provided picture in an ImageView in such a way that the whole ImageView is filled with as much of the picture possible.

This is how I do it:

var image = require('image');

Ti.Media.showCamera({
        mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
 success: function (e) {