Skip to content

Instantly share code, notes, and snippets.

View Demwunz's full-sized avatar
:octocat:
donuts

Fazal Demwunz

:octocat:
donuts
View GitHub Profile
@Demwunz
Demwunz / scss_loop.scss
Last active August 29, 2015 13:56
scss_each_loop.scss
/*
* a way to save time when you want to output a bunch of class names with corresponding filenames
*/
$icons: sprite-map("icons/*.png");
.select-custom--icons{
background-image: sprite-url($icons);
background-color:white;
background-repeat: no-repeat;
}
$languages : (en, zh-cn, ja, it, pt, es, de);
@Demwunz
Demwunz / pgp
Last active August 29, 2015 14:24
pgp
```
-----BEGIN PGP MESSAGE-----
Comment: GPGTools - https://gpgtools.org
owF1Uk1sFVUUfq9Sfp5CcaEiNVhnoVEf7f2dO9MFkSI2YGMQQaMhPu6de+a94dGZ
dua9lpZUFkTUYE1DRTYixGqLf4mgSV0INAQ1pV3UaEOTmvgTDcFglBAWRKLeaWqE
hbt7zv3Od873nTOw9JZMLvtH2+TBib8nX85OXFSZrYP19++2VKR7rObdlrczgLCS
vkLZDlazVYYeJRNoDKKGMNLQuCNpmMfkrS6IkyAKDQo1ikbX6sun8LTYD8IixB1x
kHJZknu2oADKBt8hjCstOCJYKY8iqqTjA/UcG7mGshQllZu6WnOchUCbbMs6g29Z
6zy2nq6bx1fnPmxXgJaaKM0VFp4rHVtKIJIiWwBCKAUmEM9L0tDeXQ1703HbIS7v
@Demwunz
Demwunz / onename.txt
Created July 29, 2015 15:36
onename verification
Verifying I am +demwunz on my passcard. https://onename.com/demwunz
@Demwunz
Demwunz / template_switcher.php
Last active October 1, 2015 07:48
Static Template browser
<?php
$directory = '';
$pages = glob($directory . "*.php");
foreach($pages as $page){
$thelist .= '<option value="'.$page.'">'.$page.'</option>';
}
?>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
@Demwunz
Demwunz / ie6png.js
Created March 9, 2012 16:48
JavaScript: lightweight IE6 png fix
/*@cc_on
@if (@_win32)
try {document.execCommand('BackgroundImageCache', false, true);}catch(e){}
@end
@if (@_jscript_version <= 5.6)
(function pngFix (gif, arr) {
var k = arr.length, el, es;
while (k--) {
if (el=document.getElementById(arr[k])) {
es=el.style;es.height=el.height;es.width=el.width;es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', src='"+el.src+"',sizingMethod='image')";el.src=gif;
@Demwunz
Demwunz / jquery.slideshow.js
Created March 9, 2012 16:50
JavaScript: lightweight jQuery slideshow
var slideContainer = $('.carousel'),
slides = slideContainer.find('li'),
slideCount = slides.length,
oldSlide = 0,
currentSlide = 0,
fadeSpeed = 500,
slideSpeed = 4000,
auto = true,
animating = false,
tabs = $('.tabs, .carousel-links').find('li'),
@Demwunz
Demwunz / modernizr_jquery_placeholder_fix.js
Created March 14, 2012 16:27
JavaScript: Modernizr & jQuery placeholder replacement
if(!Modernizr.input.placeholder){
$('input[type=text]').each(function(i, elem) {
var input = $(elem),
placeholder = input.attr('placeholder');
if (this.defaultValue === '') {
this.defaultValue = placeholder;
}
input.on('focus', function () {
this.value == this.defaultValue ? this.value = '' : null;
})
@Demwunz
Demwunz / trim_text.jquery.js
Created March 15, 2012 16:39
JavaScript: trim text
trimText : function(obj, body, length){
var splitLocation = body.indexOf(' ', length);
if(splitLocation != -1) {
// truncate tip
var splitLocation = body.indexOf(' ', length),
str1 = body.substring(0, splitLocation),
str2 = body.substring(splitLocation, length - 1);
obj.html(str1 + '<span class="truncate_ellipsis">&hellip;</span>' + '<span class="truncate_more">' + str2 + '</span>');
obj.find('.truncate_more').css("display", "none");
}
@Demwunz
Demwunz / jquery.inview-pseudo.js
Created March 30, 2012 14:21
jQuery : inview psuedo-selector
//this is straight from http://forrst.com/posts/jQuery_inview_selector-V2Q
$.extend($.expr[':'], {
inview: function(el) {
var e = $(el),
w = $(window),
wt = w.scrollTop(),
wb = wt + w.height(),
et = e.offset().top,
eb = et + e.height();
@Demwunz
Demwunz / deviceorientation.js
Last active October 5, 2015 06:18
Check if Media Query has fired, device orientation and device type (via categorizr classes)
DASEFX ={
common:{
init: function(){
//using http://benalman.com/code/projects/jquery-throttle-debounce/docs/files/jquery-ba-throttle-debounce-js.html
$(window).resize( $.throttle( 250, true, function(e){
log('resized');
DASEFX.common.MediaQueryCheck();
}));
},