Skip to content

Instantly share code, notes, and snippets.

View Idered's full-sized avatar
📸
Working on chalk.ist

Kasper Mikiewicz Idered

📸
Working on chalk.ist
View GitHub Profile
@Idered
Idered / exif-reader.js
Last active August 29, 2015 14:19
Adobe Lightroom 6 wrong exif read
// This is part of exif reader which throws error
if (oFile.getLongAt(iTIFFOffset+4, bBigEnd) != 0x00000008) {
if (bDebug) console.log("Not valid TIFF data! (First offset not 8)", oFile.getShortAt(iTIFFOffset+4, bBigEnd));
return false;
}
@Idered
Idered / gist_shorthand.php
Created February 4, 2012 16:29
Gist shortcode for Wordpress
<?php
function gist_shortcode($atts) {
return sprintf(
'<script src="https://gist.github.com/%s.js%s"></script>',
$atts['id'],
$atts['file'] ? '?file=' . $atts['file'] : ''
);
.hide-parent {
float: right;
position: absolute;
top: 10px;
right: 10px;
}
.hide-parent:hover {
color: #fff !important;
border: 0 !important;
}
@Idered
Idered / curlQuery.php
Last active October 7, 2015 13:38
curlQuery
/**
* Pobiera dane ze wskazanego adresu URL poprzez cURL.
*
* @todo Ta funkcja jest zbyt ogólna, by znajdować się w komendach czata.
* @param string $url Adres URL.
* @param array $headers Nagłówki, jakie należy przesłać razem z zapytaniem.
* @param bool $isPost Informacja, czy zapytanie ma zostać zadane metodą POST. Jeśli false, będzie użytwa metoda GET.
* @param mixed $data Dane do przesłania metodą post.
* @return string
*/
@Idered
Idered / README.md
Created January 25, 2013 03:23 — forked from zenorocha/README.md

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@Idered
Idered / debug.css.js
Last active December 14, 2015 14:49
Debug bookmarklets
javascript:
var CSSRefresh = {
styleSheets: [],
init: function() {
var links = document.getElementsByTagName("link"),
lastModified;
@Idered
Idered / zipit.php
Created August 9, 2013 14:44
Zip FTP "/public" -> public.min.zip
<?php
function Zip($source, $destination)
{
if (!extension_loaded('zip') || !file_exists($source)) {
return false;
}
$zip = new ZipArchive();
if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
return false;
@Idered
Idered / radio.css
Last active December 23, 2015 21:59
Editr Sample
/** %[Object] Radio buttons */
/*------------------------------------*/
@-webkit-keyframes pulse {
0% { width: .7em; height: .7em; margin: .4em; }
50% { width: 1.1em; height: 1.1em; margin: .2em; }
100% { width: .9em; height: .9em; margin: .3em; }
}
@-moz-keyframes pulse {
0% { width: .7em; height: .7em; margin: .4em; }
@Idered
Idered / script.js
Created January 5, 2014 04:41
Remove first and last empty lines, remove useless indentation. Good for parsing HTML
var str = '\n\n\n Multiline text\n with indentation\n damn.\n\n\n';
// remove first and last empty lines
str = str.replace(/^[\r\n]+|[\n\r]+$/gi, '');
var indentTab = str.match(/\t*/) != '',
indentSize = indentTab ? 1 : str.match(/\s*/)[0].length,
regex = new RegExp('^(?:' + (indentTab ? '\\t' : ' {' + indentSize + '}') + ')', 'mg');
// Remove indent
@Idered
Idered / pclzip.lib.php
Last active July 21, 2016 15:36
Unzip file with php
<?php
// --------------------------------------------------------------------------------
// PhpConcept Library - Zip Module 1.3
// --------------------------------------------------------------------------------
// License GNU/LGPL - Vincent Blavet - January 2003
// http://www.phpconcept.net
// --------------------------------------------------------------------------------
//
// Presentation :
// PclZip is a PHP library that manage ZIP archives.