Skip to content

Instantly share code, notes, and snippets.

View glsee's full-sized avatar

Kaiden / GL glsee

View GitHub Profile
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@gottaloveit
gottaloveit / rebuld_nginx_with_pagespeed.sh
Last active July 9, 2016 15:20
This is a script for Debian/ Ubuntu that will rebuild the latest Nginx deb package from nginx.org with Google Pagespeed. There are a couple other modules the script will prompt you to ask if you want to remove them. They are http-dav, http-flv, http-mp4, mail, mail_ssl. Will prompt to add http-geoip and ask if you want to change the nginx user t…
#!/bin/bash
echo "This script will rebuild a Debian style package (deb) of latest stable"
echo "Nginx. The original deb is from nginx.org apt repository."
echo
echo "This will prompt you yes or no on a few changes to the build as well as"
echo "it will compile and package the latest Google NGX Pagespeed module."
echo
echo "This is built and tested on Ubuntu 14.04 LTS, fresh OS install."
echo "There are no guarantees, and I take no liability if it breaks, but it"
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@canton7
canton7 / 0main.md
Created September 17, 2012 12:57
Git Bisect and Feature Branches

Git Bisect and Feature Branches

There are people out there who claim that merge-based workflows (that is, workflows which contain non-fast-forward merges) are bad. They claim that git bisect gets confused by merge-based workflows, and instead advocate rebase-based workflows without explicit feature branches.

They're wrong.

Furthermore, the "advantages" of their workflows are in fact disadvantages. Let me show you.

@madrobby
madrobby / gist:3733875
Created September 16, 2012 19:09
Fade out elements on WebKit and Firefox
<style>
.fade-right {
-webkit-mask-image: -webkit-gradient(linear, left top, right top, from(rgba(0,0,0,1)), color-stop(0.75, rgba(0,0,0,1)), to(rgba(0,0,0,0)));
mask: url(#fade_right_svg_mask);
}
#mask_demo {
background: #d0d0d0;
height: 100px;
width: 500px;
padding: 10px;
@nikic
nikic / password_hashing_api.md
Created September 12, 2012 15:04
The new Secure Password Hashing API in PHP 5.5

The new Secure Password Hashing API in PHP 5.5

The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:

Why do we need a new API?

Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.

@romannurik
romannurik / SwipeDismissListViewTouchListener.java
Last active May 1, 2021 10:16
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
Moved to
https://github.com/romannurik/android-swipetodismiss