This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAvatar(){ | |
var avatars = ["01","02","03","04","05","06","07","08"]; | |
var rand = Math.floor(Math.random() * avatars.length); | |
return '//assets.diariolibre.com/img/midl/miDLavatar-'+avatars[rand]+'.png'; | |
} | |
var tmp_avatar = getAvatar(); | |
function loadUserData(token){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
query_posts("showposts=40&meta_key=Materia_1&orderby=title&order=DESC"); | |
$coma; | |
if (have_posts()) : while (have_posts()) : the_post(); | |
$do_not_duplicate = $post->ID; | |
$materias[] = get_post_meta(get_the_ID(), 'Materia_1', true); | |
//$found = explode("," , get_post_meta(get_the_ID(), 'Materias', true)); | |
$coma = get_post_meta(get_the_ID(), 'Materias', true); | |
endwhile; | |
//$found = array_count_values($materias); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Edit node_modules/metro-config/src/defaults/blacklist.js | |
Change sharedBlacklist to: | |
var sharedBlacklist = [ | |
/node_modules[\/\\]react[\/\\]dist[\/\\].*/, | |
/website\/node_modules\/.*/, | |
/heapCapture\/bundle\.js/, | |
/.*\/__tests__\/.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Si el usuario pertenece a uno o varios grupos y estos grupos tienen permisos, no muestres estos permisos en el campo para asignar permisos individuales en django admin | |
""" | |
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin | |
from django.contrib.auth.models import Group, Permission | |
class UserAdmin(BaseUserAdmin): | |
def get_form(self, request, obj=None, **kwargs): | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function listOverrideColumnValue($record, $columnName, $definition) { | |
if ($columnName == 'created_at') { | |
// apply local timezone | |
$createdAt = (new \DateTime($record->created_at))->setTimezone(new \DateTimeZone('America/Santo_Domingo')); | |
return $createdAt->format('d/m/Y g:ia'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout <commit>^ -- <file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You might check the permissions on android/gradlew | |
They should be 755 not 644 | |
Run chmod 755 android/gradlew inside your app root folder | |
then run react-native run-android |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// WelcomeViewController.swift | |
// | |
// Created by Juan Miguel Calcano on 2/2/15. | |
// Copyright (c) 2015 Juan Miguel Calcano. All rights reserved. | |
// Swift version of an Objective-C UIPageControl tutorial (https://www.youtube.com/watch?v=abRCY5St_EM) | |
// UPDATE: swipe UIPageControl | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from appx.models import NormalModel, DataMultipleModel | |
def crearAlgo(request): | |
form = NormalForm() | |
formset_data= DataFormset(instance=NormalModel()) | |
if request.method == 'POST': | |
form = NormalForm(request.POST) | |
if form.is_valid(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var $targetElement = '.wordBreak'; | |
if($.browser.msie) { | |
$($targetElement).css('word-break', 'break-all'); | |
} else { | |
$($targetElement).each(function(){ | |
if(navigator.userAgent.indexOf('Firefox/2') != -1) { | |
$(this).html($(this).text().split('').join('<wbr />')); | |
} else { | |
$(this).html($(this).text().split('').join(String.fromCharCode(8203))); |