Skip to content

Instantly share code, notes, and snippets.

View curiositry's full-sized avatar

Curiositry curiositry

View GitHub Profile
@curiositry
curiositry / placeholder_styles
Created August 28, 2013 18:39
The code needed to style HTML5 input placeholder text.
::-webkit-input-placeholder { /* WebKit browsers */
color: #555;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #555;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #555;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
@curiositry
curiositry / text_selection_style
Created August 28, 2013 18:41
CSS to style selected text differently from how the OS/Browser displays it be default.
::-moz-selection {
background-color: #777;
color: #fff;
}
::selection {
background-color: #777;
color: #fff;
}
@curiositry
curiositry / CSS_headers_and_compression
Created August 28, 2013 18:44
For those using PHP as a CSS preprocessor, this snippet sets the headers and also enables gzipping.
<?php ob_start ("ob_gzhandler");
header("Content-type: text/css; charset: UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);
?>
@curiositry
curiositry / gradient_line
Created August 28, 2013 18:47
A neat gradient line snippet. Dependent on flexbox_functions.php. You could use the straight flexbox code or some other alignment system.
.gradient_line{
<?php flexbox::align_items_center(); ?>
height: 1px;
background: black;
width: 100%;
background: -webkit-gradient(linear, 100% 100%, 0 0, from(white), to(white), color-stop(50%, black));
background: -moz-linear-gradient(left, #FFF 0%, #444 50%, #fff 100%);
background: -o-gradient(linear, 0 0, 100% 0, from(white), to(white), color-stop(50%, black));
clear:all;
}
@curiositry
curiositry / smooth_scroll.js
Created September 29, 2013 00:39
A handy smooth scroll snippet that requires no extra markup and breaks modals.
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
@curiositry
curiositry / url_slugger.php
Created December 5, 2013 21:09
A function to convert strings to SEO friendly URL slugs from www.cubiq.org
setlocale(LC_ALL, 'en_US.UTF8');
function toAscii($str, $replace=array(), $delimiter='-') {
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
$clean = strtolower(trim($clean, '-'));
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
@curiositry
curiositry / _opentype-features.scss
Created March 4, 2014 05:51
A basic SASS mixin that makes OpenType features easier to work with on the web.
@mixin openTypeFeatures(
$discretionary,
$historical,
$proportional-nums,
$tabular-nums,
$oldstyle-nums,
$lining-nums,
$superscript,
$subscript,
$scientific-inferiours,
@Photosynthesis
Photosynthesis / convert_obci_csv_to_openvibe.py
Last active July 25, 2019 09:44
Convert OpenBCI CSV data to Openvibe format
import csv
import os
import sys
''' CONFIG '''
# PATHS
''' Path relative to this script for input data files '''
input_path = 'input'
@Pengor
Pengor / IteratedToTimed.py
Created April 8, 2015 03:27
Converts iterated data to timed data. For use with OpenBCI output files.
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("in_file", type=str)
parser.add_argument("out_file", type=str)
args = parser.parse_args()
inFile = open(args.in_file,'r')
outFile = open(args.out_file,'w')
@Pushplaybang
Pushplaybang / free-meteor-deployment-heroku.md
Last active July 29, 2019 13:38
no frills instructions for getting meteor up on a free heroku and mongolab instance, no credit card required.

Prerequisites

You're going to need to create accounts at both Heroku and mlab, get the heroku toolbelt, create a database and get the full db url with the credentials.

  1. Have a meteor project you want to deploy setup on GIT
    • if your not yet on git, you'll need to get up to speed before proceeding with this, of course you should be on git, versioning all your work, and luckily getting started is pretty easy. You'll also need a github account to follow this tutorial.
  2. Setup a Heroku Account here
  3. Setup a mongo lab account
  4. Install the Heroku tool belt
  5. create a new db on mlab
  6. create a new user for that db