Skip to content

Instantly share code, notes, and snippets.

View monotv's full-sized avatar
⚛️
React Native & React developer

Florian monotv

⚛️
React Native & React developer
View GitHub Profile
@Paratron
Paratron / promisifyModule.js
Last active December 12, 2018 15:11
This node module will consume another module and promisify all of its functions.
const {promisify} = require('util');
const promisifyModuleFunctions = (inModule) => Object
.entries(inModule)
.reduce((outModule, [key, property]) => {
outModule[key] = (typeof property === 'function')
? promisify(property)
: property;
return outModule;
@Paratron
Paratron / async-nodeJS.js
Created December 12, 2018 13:20
Simple async functionality for native style nodeJS functions
// The normal async programming flow in nodeJS can get hairy, quickly:
function readAndParse(filename, callback){
fs.readFile(filename, 'utf8', (err, data) => {
if(err){
callback(err, null);
return;
}
myParser.doParsing(data, (err, result) => {
# Before Script
before_script:
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh
# Services
services:
@davekiss
davekiss / gist:a3f58ae284bde8397cb6
Last active June 19, 2016 21:28
Localizing and Translating WordPress Plugins

1. Load the Text Domain

add_action( 'init', array($this, 'vimeography_load_text_domain') );

public function vimeography_load_text_domain() {
  load_plugin_textdomain('vimeography', false, dirname( VIMEOGRAPHY_BASENAME ) . '/languages/');
}

2. Localize Strings

@FokkeZB
FokkeZB / IMPORT.md
Last active May 24, 2023 21:24
Add support for @import to Alloy styles

@import TSS for Alloy

NOTE: This is out-dated, I suggest using https://github.com/dbankier/ltss instead.

This alloy.jmk adds support for using CSS-like @import "file.tss"; statements in Alloy TSS styles.

The idea for this came when discussing adding the option of including a CSS-like reset stylesheet in Alloy to make up for platform differences in (background)color, but also some good practices.

I think one of the key issues in this discussion is that there is no such thing as the base style for an app. iOS fans would like to reset to iOS-like styles, Android fans like to reset to theirs, flat UI fanatics would like everything minimalized and Bootstrap adepts will ask for a huge library of styles.

@eric-hu
eric-hu / TiDocs.sh
Created February 14, 2013 11:36
Getting offline version of Titanium mobile docs on Ubuntu
#! /bin/sh
# Run this from the folder you want to be the parent of your docs
# By default, generated docs go into
# titanium_mobile/dist/apidoc/ti_mobile_docs/
#
# This can be changed below
git clone https://github.com/appcelerator/titanium_mobile.git
cd titanium_mobile
sudo apt-get install python-setuptools python-dev
@mschmulen
mschmulen / TableViewNeverending.js
Created February 1, 2011 02:07
Titanium tableView with a continuous amount of data.
//
// in this demo, we simply show how you could dynamically scroll
// with a continuous amount of data in the tableview by detecting
// when the user's scroll position gets near the end of the table
// and start a background fetch of new data and seamlessly append
// the new data to the table automatically
//
var win = Ti.UI.createWindow();