Skip to content

Instantly share code, notes, and snippets.

View nonoesp's full-sized avatar
💭
Getting Simple

Nono Martínez Alonso nonoesp

💭
Getting Simple
View GitHub Profile
@nonoesp
nonoesp / PHP Key Restriction GET
Created October 19, 2013 18:28
PHP key-restricted content with GET. If high security is needed it would be better to use POST.
<?php
/**
Sample to get a url variable through GET method
Example URL: ../sample.php?apikey=MY_KEY
*/
// Define the API key here
$APIKey = 'MY_KEY'; // this is the key that the app has to send on the URL
@nonoesp
nonoesp / [Bookmark] Facebook Hide All But Chat
Last active August 29, 2015 13:57
Avoid distractions. Hide Facebook's interface but the chat.
javascript:function hide(){ document.getElementById('content').style.opacity='0';document.getElementById('pagelet_bluebar').style.opacity='0';document.getElementById('pageFooter').style.opacity='0';}hide();
@nonoesp
nonoesp / Partial Translation Fallback with Laravel
Last active August 29, 2015 14:21
Partial translation fallback — to fallback_locale — using dimsav/translatable with Laravel.
$translatableFallbackLocale = Config::get('translatable::fallback_locale');
$project = Project::find($id);
$project_default = $project->translate($translatableFallbackLocale);
// Translations
if(!$project->title) {
$title = $project_default->title;
} else {
$title = $project->title;
}
@nonoesp
nonoesp / BoxProjectTo2D
Created November 17, 2015 19:44
Processing sketch to project corners of a 3D box to 2D screen space.
// Nono Martínez Alonso (@nonoesp) (www.nono.ma)
// 151027
boolean shouldSaveFrames = false; // Set to true to export footage frames
PShape s;
void setup(){
size(800, 600, P3D);
pixelDensity(displayDensity());
.Trends,
.flex-module,
[data-nav=moments],
.dm-nav,
#global-new-tweet-button,
.Icon--bird {
display: none;
}
* {
border: none;
font-family: "ITC Franklin Gothic Std";
font-weight: 400;
}
div.box.homescreen:last-of-type {
display: none;
}
@nonoesp
nonoesp / [Stylebot] Simple Gmail
Last active November 9, 2016 17:16
Removes the unread email counter from the Inbox button.
* {
font-weight: 400;
}
[title*="Inbox"].n0 {
visibility: hidden;
}
[title*="Inbox"].n0:before {
content: "Inbox";
@nonoesp
nonoesp / makeGIF.sh
Created May 18, 2017 19:32
Create a GIF with ImageMagick
convert -delay 30 00.png 01.png 02.png 03.png 04.png n.png animation.gif
GetAvailablePort(8080);
@nonoesp
nonoesp / JavaScript to generate URLs
Last active June 7, 2019 17:31
SketchRNN model URLs
let models = [
'cat',
'bird',
'bicycle',
'octopus',
'face',
'flamingo',
'cruise_ship',
'truck',
'pineapple',