Skip to content

Instantly share code, notes, and snippets.

View botmaster's full-sized avatar
🎧

Pascal Achard botmaster

🎧
View GitHub Profile
// clearfix
@mixin clearfix {
&::after {
content: "";
display: block;
clear: both;
}
}
// edit font rendering -> tip: use for light text on dark backgrounds
@sarahdayan
sarahdayan / modifiers.scss
Last active October 31, 2023 18:28
Sass Modifiers Mixin
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Sass modifiers mixin by Sarah Dayan
// Generate All Your Utility Classes with Sass Maps: frontstuff.io/generate-all-your-utility-classes-with-sass-maps
// http://frontstuff.io
// https://github.com/sarahdayan
@paceaux
paceaux / tinyRules.css.md
Last active April 3, 2024 01:19
Tiny rules for how to name things in CSS and JS

Tiny rules for how to name stuff

CSS

How to name CSS classes

Stateful Class names

Is it a state that is only one of two conditions? (i.e. a boolean)

@mlynch
mlynch / cordova-plugin-guide.md
Last active February 3, 2023 00:21
Cordova Plugin Developer Guide

Cordova Plugin Development Guide (iOS and Android)

Version: 0.0.1 updated 7/1/2016

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

Building Cordova plugins is scary for many Cordova and Ionic developers, but it doesn't have to be. This simple guide walks through the what, when, why, and how of Cordova plugin development for iOS and Android.

Introduction

@yomybaby
yomybaby / example.js
Last active November 11, 2016 02:11
promise httpRequest using Q on Titanium
qHttp({
url: 'YOUR_URL',
method: "POST",
data: {
"access_token" : 'YOUR_TOKEN'
}
}).then(function (args){
// step 2 : other request
return qHttp({
@falkolab
falkolab / resizeToContainer.js
Created January 28, 2016 14:57
Titanium SDK helper to resize
function resizePhoto(blob, size) {
var measurement = require('alloy/measurement'), w, h;
if (blob.width / blob.height >= size.width / size.height) {
w = measurement.dpToPX(size.width);
h = blob.height * measurement.dpToPX(size.width) / blob.width;
} else {
w = blob.width * measurement.dpToPX(size.height) / blob.height;
h = measurement.dpToPX(size.height);
@benbahrenburg
benbahrenburg / app.js
Last active February 6, 2018 09:46
Titanium Settings Dialog Examples
Ti.UI.setBackgroundColor('#000');
var alertSettings = require("settings-dialog");
var win = Ti.UI.createWindow({
title:'Example', backgroundColor:'#fff', layout:"vertical"
});
win.add(Ti.UI.createLabel({
text:"Example on now to prompt user to change settings",
@lazabogdan
lazabogdan / SassMeister-input.scss
Last active August 14, 2020 18:10
Sass spacing utility
// ----
// libsass (v3.3.2)
// ----
$spacer: 1rem;
$spacer-x: $spacer;
$spacer-y: $spacer;
$spacers: ();
@falkolab
falkolab / SVGProduct.js
Created October 30, 2015 11:47
How to use SVG as autogenerated raster image
// app/lib/SVGProduct.js
function getImageFileFromSVG(svgOpts, name) {
var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationCacheDirectory,
Ti.Utils.md5HexDigest(JSON.stringify(svgOpts)));
if (!file.exists()) {
var SVG = require('com.geraudbourdin.svgview');
if (!file.write(SVG.createView(svgOpts).toImage())) {
Ti.API.error("Can't save to file. Product:", name);
return null;
@falkolab
falkolab / index.js
Created October 29, 2015 11:45
How to use SVG as View backgroundImage
$.getView().backgroundImage = getImageFileFromSVG({
image : "/images/hearts.svg",
width : 400,
height : 400,
top : 0,
left : 0
});
function getImageFileFromSVG(svgOpts) {
var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationCacheDirectory,