Skip to content

Instantly share code, notes, and snippets.

View gnclmorais's full-sized avatar
🐙
Growing a beard

Gonçalo Morais gnclmorais

🐙
Growing a beard
View GitHub Profile
import java.util.regex.Pattern
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
@Couto
Couto / SSL_cert_creation.sh
Last active January 2, 2016 02:39
Create random SSL certificates for use in development.
# Generate SSL Certificate for dev
export DOMAIN="example.dev"
export PASSPHRASE=$(head -c 500 /dev/urandom | tr -dc a-z0-9A-Z | head -c 128; echo)
export SUBJ="
C=PT
ST=Aveiro
O=Example Organization
localityName=Aveiro
commonName=$DOMAIN
@jonbretman
jonbretman / type.js
Last active January 16, 2024 01:16
Simple type checking in JavaScript.
(function (root) {
var type = function (o) {
// handle null in old IE
if (o === null) {
return 'null';
}
// handle DOM elements
@trantorLiu
trantorLiu / handlebars-pagination-helper.js
Last active August 10, 2023 14:01
Handlebars pagination helper.
Handlebars.registerHelper('pagination', function(currentPage, totalPage, size, options) {
var startPage, endPage, context;
if (arguments.length === 3) {
options = size;
size = 5;
}
startPage = currentPage - Math.floor(size / 2);
endPage = currentPage + Math.floor(size / 2);
@Couto
Couto / globalVariables.js
Last active June 6, 2016 15:47
Small snippet to detect global variables.
(function (global) {
'use strict';
var globals = [];
var iframe = document.createElement('iframe');
var cleanWindow;
iframe.src = 'about:blank';
iframe.style.display = 'none';
document.body.appendChild(iframe);
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 30, 2024 04:42
A badass list of frontend development resources I collected over time.
@maxkandler
maxkandler / gist:5233150
Created March 24, 2013 19:25
Hide the iTerm2 Dock icon.
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@cowboy
cowboy / call-invo-cursion.js
Last active March 30, 2023 01:59
JavaScript: call invo-cursion?
// OOP
console.log( 'OHAI'.blink() );
// Call invocation
console.log( String.prototype.blink.call('OHAI') );
// $ always makes things look awesome.
var $ = Function.prototype.call;
// Very explicit call invocation
@lightyrs
lightyrs / Custom.css
Created December 17, 2012 08:26
My Chrome Dev Tools Skin incorporates the sleek visual style of codepen.io with some of my own usability enhancements. Pictured here with Monokai color scheme ( http://imgur.com/mbrqt ).
/*
Chrome Developer Tools - Monokai Color Theme
Author: Béres Máté Csaba / bjmatt.com / @bjmatt / beres.mate@bjmatt.com
-----------------------------------------------------------------------------------------------------------
Installation:
1. Find your Chrome's user stylesheets directory: