Skip to content

Instantly share code, notes, and snippets.

View tarto-dev's full-sized avatar
🎃
Never Gonna Give You Up 🎵

Clara C. tarto-dev

🎃
Never Gonna Give You Up 🎵
  • Conserto
  • Nantes, France
View GitHub Profile
function tweetscore(){
//share score on twitter
var tweetbegin = 'http://twitter.com/home?status=';
var tweettxt = 'I scored '+tweetnumber+' at this game -' + window.location.href + '.';
var finaltweet = tweetbegin +encodeURIComponent(tweettxt);
window.open(finaltweet,'_blank');
}
git checkout develop
git fetch
git remote prune origin
#Remove locally
git branch --merged develop | grep -v 'develop$' | xargs git branch -d
echo "Branches merged, to delete:"
git branch -r --merged develop | sed 's/ *origin\///' | grep -v 'develop$'
(function ($) {
Drupal.behaviors.autoUpload = {
attach: function(context, settings) {
$('.form-item input.form-submit[value=Upload]', context).hide();
$('.form-item input.form-file', context).change(function() {
$parent = $(this).closest('.form-item');
//setTimeout to allow for validation
//would prefer an event, but there isn't one
setTimeout(function() {
<!DOCTYPE html>
<html>
<head>
<title>Capture Photo</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
var pictureSource; // picture source
var destinationType; // sets the format of returned value
<?php
$protocol = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
if (substr($_SERVER['HTTP_HOST'], 0, 4) !== 'www.') {
header('Location: '.$protocol.'www.'.$_SERVER['HTTP_HOST'].'/'.$_SERVER['REQUEST_URI']);
exit;
}
(function ($) {
"use strict";
Drupal.behaviors.origin3_user = {
attach: function (context, settings) {
var user_id = settings.origin3_user_user_proof.userId;
var deleteBaseUrl = settings.origin3_user_user_proof.deleteUrl;
$('#origin3-user-user-document-form input[type="file"]').each(function () {
$(this).css('opacity', 0);
function FormatNumber(val) {
var split = val.split('.');
if (split.length > 1) return OnlyNumbersAllowed(split[0]) + '.' + OnlyNumbersAllowed(split[1]);
else return OnlyNumbersAllowed(split[0]);
}
function OnlyNumbersAllowed(val) {
return val.replace(/\D/g, '');
}
develop-ntqn2d476ooru.eu.platform.sh/en
@tarto-dev
tarto-dev / .bash_profile
Created November 12, 2015 16:00
Donc, tu n'as qu'a copier les 3 fichiers chez toi (Append si existants)
export PS1="[\[$(tput sgr0)\]\[\033[38;5;11m\]\t\[$(tput sgr0)\]\[\033[38;5;15m\]]\[$(tput sgr0)\]\[\033[38;5;32m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\h \[$(tput sgr0)\]\[\033[38;5;6m\][\[$(tput bold)\]\w\[$(tput sgr0)\]]\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;9m\]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
alias got='git'
alias brl='git brrm | sed -n 2p | pbcopy'
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'API-KEY' );
$ids = array( $_GET['id'] );
// prep the bundle
$message = array
(
'message' => 'Push notification message',
'title' => 'Title text',
'subtitle' => 'Subtitle Text',