Skip to content

Instantly share code, notes, and snippets.

View edgarberm's full-sized avatar
:octocat:
NaN

Edgar Bermejo edgarberm

:octocat:
NaN
View GitHub Profile
@runspired
runspired / form.html
Created May 23, 2016 13:46
How to turn off password and email/username autocomplete.
<!--
<form autocomplete="off"> will turn off autocomplete for the form in most browsers
except for username/email/password fields
-->
<form autocomplete="off">
<!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields -->
<input id="username" style="display:none" type="text" name="fakeusernameremembered">
<input id="password" style="display:none" type="password" name="fakepasswordremembered">
@baptistebriel
baptistebriel / admin.php
Last active August 26, 2022 10:14
[WordPress] - Collection of WordPress Snippets
<?php
// Show something only if the user is logged / admin.
// To be used in the current theme files - front.
if (current_user_can('manage_options')){ ?>
<div class="work">
<div class="work_layer">
<div class="device-content row">
<div class="work_content right">
<span class="f_13 uppercase sub_title">Web</span>
function functionToCallOnorientationChange() {
var orientation = screen.mozOrientation;
if (orientation === "portrait-primary" || orientation === "portrait-secondary" ) {
//do something
}
else if if (orientation === "landscape-primary" || orientation === "landscape-secondary" ) {
//do something else
}
}
@davestewart
davestewart / gist:4516020
Last active December 11, 2015 00:19
Publish Hooks class for xJSFL
/**
* Publish Hook class
*
* Features:
*
* - Runs pre and post publish hooks (any file on your hard drive, even other JSFL scripts)
* - Has a simple XUL UI to browse for files
* - Can load and save different profiles, say one for games, one for web
* - Stores setting in an XML config file, but could just as easily store those settings per document using document data
* - Can be set as Active or Inactive should you decide you need to disable it
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@PrimaryFeather
PrimaryFeather / ClippedSprite.as
Created April 19, 2012 17:02
Simple Sprite subclass with a rectangular mask in stage coordinates
package starling.extensions
{
import flash.display3D.Context3D;
import flash.geom.Point;
import flash.geom.Rectangle;
import starling.core.RenderSupport;
import starling.core.Starling;
import starling.display.DisplayObject;
import starling.display.Sprite;
@larryfox
larryfox / LICENSE.txt
Last active February 22, 2022 21:27
Determine if an elements background color is light or dark!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2015 Larry Fox <http://larryfox.us>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE