Skip to content

Instantly share code, notes, and snippets.

@makepanic
makepanic / natcasesortWrite.php
Created March 23, 2012 18:08
a PHP natcasesort function that returns a sorted array with modified indexes
function natcasesortWrite($arr){
natcasesort($arr);
return array_values($arr);
}
@makepanic
makepanic / c.log.js
Created September 10, 2012 18:51
console log wrapper
var c = {
/*
* @reference: http://blog.rndm.de/p/console-log-wrapper
* @author: Christian http://rndm.de/
* @license: Licensed under Apache License v2.0. See http://www.apache.org/licenses/LICENSE-2.0
*
* example: c.log("Hello World")
* @param obj - variable to log
* @param trace - boolean display console.trace()
*/
@makepanic
makepanic / wordcount.js
Created September 21, 2012 22:17
wordcount
<textarea id="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</textarea>
<script>
var wc = {
/* @pa
@makepanic
makepanic / nycsubway.js
Created January 9, 2013 16:11
nycsubway.org Historical_Maps inline images
$('#mw-content-text a').each(function(index, value){
var href = value.href,
gif = 'gif',
jpg = 'jpg',
base = 'http://images.nycsubway.org/',
isImage = false;
if(href.indexOf(gif, href.length - gif.length) !== -1 ||
href.indexOf(jpg, href.length - jpg.length) !== -1){
isImage = true;
@makepanic
makepanic / lib32-alsaequal.log
Last active December 17, 2015 05:08
arch lib32-alsaequal
problem:
ALSA lib dlmisc.c:236:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib32/alsa-lib/libasound_module_pcm_equal.so
> uname -a
Linux momo 3.8.11-1-ARCH #1 SMP PREEMPT Wed May 1 20:18:57 CEST 2013 x86_64 GNU/Linux
> sudo packer -S lib32-alsaequal
Aur Targets (2): lib32-ladspa lib32-alsaequal
@makepanic
makepanic / something-from.js
Created May 14, 2013 05:37
possible google breakout words
Abu Dhabi
Akita
Alaskan Malamute
Alcatraz Island
Almond
American Bulldog
American Staffordshire Terrier
American football
Amsterdam
Apple pie
@makepanic
makepanic / gist:6065723
Created July 23, 2013 20:12
Intellij IDEA - File Template for JavaScript Object declaration inside a closure
#set ($MODULENAME = $NAME.substring(0,1).toUpperCase() + $NAME.substring(1))
/**
* Created with ${PRODUCT_NAME}.
* User: ${USER}
* Date: ${DATE}
* Time: ${TIME}
*/
;(function(window, undefined){
'use strict';
@makepanic
makepanic / qr-capture.hbs
Created April 25, 2014 12:16
QR decode Emberjs Component
<canvas id="qr-canvas"></canvas>
<div class="camera">
<video class="camera-canvas" id="v" autoplay></video>
<div class="camera-overlay-top">
<h4>{{caption}}</h4>
</div>
<div class="camera-overlay-bottom">
{{#if recording}}
<div class="topcoat-button-bar">
@makepanic
makepanic / LICENSE.md
Last active May 29, 2018 14:34
Teamcity Widget for Dashing

The MIT License (MIT)

Copyright (c) 2014 Christian

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOF

@makepanic
makepanic / application.controller.js
Created December 7, 2015 16:49
yield template helper
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});