Skip to content

Instantly share code, notes, and snippets.

@danott
danott / entities.css
Created January 31, 2011 22:07
Use CSS's :after pseudo-selector to insert hexadecimal values of html entities into the document. Less markup. More awesome.
/* Daniel Ott
* entities.css
* 31 January 2011
*
* Adding arrows to thinks makes them more clickable. Right?
* Use CSS's :after pseudo-selector to insert hexadecimal values
* of html entities into the document. Less markup. More awesome.
*/
.add-an-arrow:after {
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@jacine
jacine / template.php
Created November 19, 2011 01:02
Bye, bye region.tpl.php and block--system--main.tpl.php
<?php
/**
* Implements hook_page_alter().
*/
function mytheme_page_alter(&$page) {
// Remove all the region wrappers.
foreach (element_children($page) as $key => $region) {
if (!empty($page[$region]['#theme_wrappers'])) {
$page[$region]['#theme_wrappers'] = array_diff($page[$region]['#theme_wrappers'], array('region'));
@adactio
adactio / twitter-user-stylesheet.css
Created December 14, 2011 23:56
CSS rules to hide "Trending Topics" and "Who To Follow" on new new Twitter.
[data-component-term="trends"] *,
[data-component-term="user_recommendations"] * {
display: none !important;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@gastongarcia
gastongarcia / Wordpress Loop Categories
Last active December 12, 2015 05:09
Wordpress Loop in Categories
<?php
//tomado directamente del Codex de Wordpress. Sección Ejemplos del Loop
//http://codex.wordpress.org/The_Loop#Loop_Examples
?>
<!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Test if the current post is in category 3. -->
<!-- If it is, the div box is given the CSS class "post-cat-three". -->
@leopic
leopic / inUrl.js
Created September 23, 2013 22:12
helper to retrieve url params
// Based off the work from https://github.com/mattpass
_.mixin({
inUrl: function(singleParam) {
var allParams = _.map(location.search.slice(1).split('&'), function(currentParam) {
return { 'Key': currentParam.split('=')[0],
'Value': decodeURIComponent(currentParam.split('=')[1]).replace(/\+/g,' '),
'Raw Value': currentParam.split('=')[1]
}
});
@rupl
rupl / gulpfile.js
Last active September 25, 2019 15:13
Sample Gulp setup. Watches JS to JSHint, watches two themes for Sass+Compass compilation.
/**
* @file
* Gulpfile that controls frontend development tasks. Just the basics!
*
* Installation: type `npm install` in your console.
* Usage: type `gulp` in your console.
*/
/* jslint node: true */
'use strict';
@leopic
leopic / Gruntfile.js
Created August 7, 2015 19:14
make a list of all the stylesheets that need to be processed, then start cranking away
/**
* Generates our CSS files using libsass.
* Wrapper for the `sass` task, make sure you have installed all the dependencies of the repo.
*
* Example: $: grunt libsass
* $: grunt libsass:dev
*
* @param env
*/
grunt.registerTask('libsass', 'Builds our CSS', function(env) {

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).