Skip to content

Instantly share code, notes, and snippets.

@nucklearproject
nucklearproject / gist:4367375
Last active December 10, 2015 02:28
My .vimrc
" Pathogen
filetype off " Pathogen needs to run before plugin indent on
call pathogen#runtime_append_all_bundles()
call pathogen#helptags() " generate helptags for everything in 'runtimepath'
filetype plugin indent on
filetype plugin on
set autoindent
set cmdheight=1 "command bar is 2 high
set backspace=indent,eol,start "set backspace function
@nucklearproject
nucklearproject / gist:4440001
Created January 3, 2013 01:16
Simple touchscreen script. Based in sftouchscreen JQuery plugin.
<?php
function user_agents(){
$devices = array('iphone', 'android', 'ipad', 'iphone', 'blackberry');
foreach ($devices as $ua) {
$tsuac[] = (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), strtolower($ua))) ? 1 : 0;
}
return (in_array(1, $tsuac)) ? '.sftouchscreen()' : '';
}
?>
<html>
jQuery(window).load(function () {
// console.log(jQuery.cookie("scrollTop"));
setTimeout(function () {
jQuery('body').trigger('resize');
}, 200);
if ('referrer' in document && typeof document.referrer != undefined) {
var url_parts = document.referrer.split("/");
var url = url_parts[0] + "//" + url_parts[2];
@nucklearproject
nucklearproject / gist:5245967
Last active March 15, 2017 00:51
Drupal simple query's
REcopilacion de consultas SQL para drupal.
<?php
// Retorna un simple valor, retorna el nomnbre de la taxonomia
function termName($tid){
$name = db_query("select name from {taxonomy_term_data} where tid=:tid",
array(':tid' => $tid))->fetchField();
return $name;
}
@nucklearproject
nucklearproject / gist:5406964
Created April 17, 2013 19:19
Javascript with detect
// Manages changes in responsive layout
var layout = (function() {
var callbacks = [];
// Container for checking changes in layout width
var $container = $('#header .container');
// Container width: screen width
var steps = {
960: 960,
@nucklearproject
nucklearproject / rows.dart
Created August 5, 2018 01:47
Flutter obtener ID
Container seleccionBlock(double rotacion, double margin, int contador) {
return Container(
margin: EdgeInsets.only(top: margin),
child: Transform.rotate(
angle: rotacion,
child: Container(
width: 110.0,
height: 196.0,
// padding: const EdgeInsets.all(4.0),
@nucklearproject
nucklearproject / ads.dart
Last active November 23, 2019 01:38
Prueba test Flutter positioned into Stack
import 'package:firebase_admob/firebase_admob.dart';
import '../services/globals.dart';
class Ads {
InterstitialAd myInterstitial;
MobileAdTargetingInfo targetingInfo = new MobileAdTargetingInfo(
testDevices: TEST_DEVICES,
/* keywords: <String>[
"tarot",
@nucklearproject
nucklearproject / test.dart
Created August 10, 2018 01:19
Create a Stack->ListView->Positioned
body: new Stack(
children: <Widget>[
new Container(
decoration: _recursos.backgroundImageComun(),
),
new Column(
children: <Widget>[
new Container(
height: 196.0,
child: new Stack(
@nucklearproject
nucklearproject / ads.dart
Last active December 26, 2019 14:17
Problema con lag al mostrar ads flutter
import 'package:firebase_admob/firebase_admob.dart';
import '../services/globals.dart';
class Ads {
InterstitialAd myInterstitial;
MobileAdTargetingInfo targetingInfo = new MobileAdTargetingInfo(
testDevices: TEST_DEVICES,
);
@nucklearproject
nucklearproject / cores.cpp
Created August 17, 2023 00:02
ESP32 support multiples dual core FreeRTOS
#include <Arduino.h>
#include <Wire.h>
// Prueba Multitarea(Hilos)RTOS en Diferente Nucleo ESP32 by: elprofegarcia.com
TaskHandle_t Tarea0; // Tarea0 parpadeo LED 0,3 segundos
TaskHandle_t Tarea1; // Tarea1 parpadeo LED 1 Segundo
// Declaraciones previas
void loop0(void *parameter);
void loop1(void *parameter);