Skip to content

Instantly share code, notes, and snippets.

Bernat Fortet bernatfortet

Block or report user

Report or block bernatfortet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 2048.js
function pressUp(){
pressKey('up');
}
function pressRight(){
pressKey('right');
}
function pressDown(){
pressKey('down');
@bernatfortet
bernatfortet / hcss.css
Last active Oct 10, 2015
HCSS Styling
View hcss.css
=== HCSS Code Styling ===
1. Inline Styles ------------------------------------------------------------------
.content{ width:100px; height:100px; display:block; position:relative; left:-5px; top:-5px; float:none; margin:0; padding:20px; background:transparent url("../images/bkg.jpg") no-repeat center center; color:#000; ....}
Order --> Widht - Height / Display / Position / left, right, top, bottom / float / margins / paddings / background / color / text types / CSS3 features (text-shadow/ border radius / box-shadow) / opacity / overflow / z-index
basically is:
1 - dimensions/structural/positioning - background and font style - the rest
View gist:4771372
/*
USAGE
timer = gameObject.AddComponent<Timer>().setup( 1f, callBackHandler );
*/
using UnityEngine;
using System.Collections;
public delegate void TimerCallback();
View aiLog.json
"request": {
"action": "onStartGame",
"params": {
"numPlayers" : "3",
"game" : "mystique",
"humanPlayers": {
"0" : "player-0000",
"1" : "player-0001"
}
"aiPlayers": {
View bookmark.js
javascript:void((function(d){var e=d.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','https://gist.github.com/bernatfortet/6bb1a5216f4eda6fbecf/raw/292644a8a69eaf5125c6c8d9807c8aa3b419622e/linkedInUserDataToClipboard.js');d.body.appendChild(e);b_linkedIn();})(document));
View gameDevMapFilter.js
var js = document.createElement('script');
js.src = 'http://code.jquery.com/jquery-1.9.1.min.js';
var first = document.getElementsByTagName('script')[0];
first.parentNode.insertBefore(js, first);
$("tr").each(function(){
var remove = true;
$(this).children("td").each(function(){
if( $(this).text() == "San Francisco" ){
remove = false;
View AllUniqueCharsInString.cs
using System;
namespace Dela.Mono.Examples
{
public class HelloWorld
{
public static void Main(string[] args)
{
string str = Console.ReadLine();
bool hasUniqueChars = true;
View gist:5565619
/* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
View jquery.easing.1.3
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
You can’t perform that action at this time.