Skip to content

Instantly share code, notes, and snippets.

View flrent's full-sized avatar
🎧

Florent Lamoureux flrent

🎧
View GitHub Profile
@flrent
flrent / gist:4060412
Created November 12, 2012 16:44
Multiple require.js file
requirejs: {
amilia: {
options: {
baseUrl:'../app/',
name:'main',
mainConfigFile: "../app/config_amilia.js",
out: "../app/build/debug/require_amilia.js"
}
},
oodili: {
@flrent
flrent / add a custom label to a window
Last active December 17, 2015 16:49
Titanium / Add a custom label to a window
var titleLabel = Titanium.UI.createLabel({
height:'18dp',
top:'10dp',
left:'50dp',
text:"My title",
textAlign:'center',
font:{
fontWeight:'semibold',
fontSize:'13dp'
},
@flrent
flrent / gist:7414020
Created November 11, 2013 14:32
Post a ticket to uservoice with node
var UserVoice = require('uservoice');
var uservoiceRequest = new UserVoice(CONSUMER_KEY, CONSUMER_SECRET, ACCOUNT_SUBDOMAIN);
var data = {
email: contact.email,
ticket: {
subject:'Subject',
message: "Message",
referrer: 'refferer'
@flrent
flrent / app.js
Created April 25, 2014 14:41
Angular update controller on service changes
angular.module('recorder', [])
.controller('MainCtrl', ['Storage', '$scope', '$timeout', function(Storage, $scope, $timeout) {
$scope.storage = Storage;
$scope.$on('valueChanged', function (evt, selectors) {
$scope.$apply(function() {
$scope.selectors = selectors;
});
});
@flrent
flrent / loginTwitter.js
Created July 10, 2023 16:07
Login on twitter automatically via Puppeeter
const loginToTwitter = async (page, username, password) => {
await page.goto('https://twitter.com/login');
await page.waitForSelector('input[autocomplete="username"][type="text"]');
const usernameInput = await page.$('input[autocomplete="username"][type="text"]');
// Type the username slowly
for (let i = 0; i < username.length; i++) {
await usernameInput.type(username[i], { delay: 100 });