Skip to content

Instantly share code, notes, and snippets.

@aTei
aTei / jquery_plugin_template.coffee
Last active December 19, 2015 02:28
jQuery plugin as CoffeeScript class template
class PluginClass
constructor: (@target) ->
_this = @ # to access Class inside @target.each and not modificate @ inside @target.each
eventData = {_class: _this} # to access Class inside event handlers
@target.each ->
self = $(@)
self.on 'click', eventData, _this.submitHandler
submitHandler: (e)->
_this = e.data._classs
e.preventDefault()
@dbu
dbu / SynchronizeTranslationsCommand.php
Created June 28, 2013 07:21
Synchronize Translations
<?php
namespace Dbu\UtilBundle\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\Loader\LoaderInterface;
@zachleat
zachleat / reading_time.rb
Last active October 21, 2020 23:00
Read this in X minutes Liquid Filter Plugin (for Jekyll)
# Outputs the reading time
# Read this in “about 4 minutes”
# Put into your _plugins dir in your Jekyll site
# Usage: Read this in about {{ page.content | reading_time }}
module ReadingTimeFilter
def reading_time( input )
words_per_minute = 180
@hlee
hlee / git_report
Created April 19, 2013 23:18
git report
#! /usr/bin/perl -w
use strict;
my $since;
if ($ARGV[0]) {
$since = $ARGV[0];
} else {
$since = "1 week ago";
}
@umpirsky
umpirsky / kill-me-please
Created April 18, 2013 20:29
After running this recursive script on Linux, you are screwed!
#!/bin/bash
./kill-me-please
anonymous
anonymous / README.markdown
Created April 8, 2013 23:18

Gist: The Script

Works great with Gist: The Website.

Installation

homebrew:

@teaholiday89
teaholiday89 / fetch.stuff
Created April 2, 2013 07:48
Fetch Libs
{
"files":
{
"angular.js": "https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js",
"dropdown.js": "https://raw.github.com/enyo/dropzone/master/downloads/dropzone.js",
"holder.js": "https://raw.github.com/imsky/holder/master/holder.js",
"howler.js": "https://raw.github.com/goldfire/howler.js/master/howler.min.js",
"jKit.js": "https://raw.github.com/FrediBach/jQuery-jKit/master/jquery-1.9.1.min.js",
"jq++": "http://jquerypp.com/downloads/jquerypp-1.0.1.zip",
"jquery.js": "http://code.jquery.com/jquery.min.js",
@emre
emre / goto.py
Last active December 14, 2015 04:29
cok fazla sunucu uzerinde calisinca cok fazla alias yazmak zorunda kalabiliyorsunuz ssh baglantilari icin. ssh auth konusunu password olmadan hallediyorsaniz goto makine1, goto solr_server, goto X seklinde ip adresleriyle ugrasmadan baglanti yapmanizi kolaylastiran ufak bir script.
#!/usr/bin/python
import os
import sys
try:
import simplejson as json
except ImportError:
import json
@yasar11732
yasar11732 / theme.html
Last active December 11, 2015 21:09 — forked from soemarko/theme.html
<!-- Aşağıdaki satırları </head> tagından önce, temanızın html dosyasına ekleyin -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Kullanımı: sayfanıza şunu ekleyin <div class="gist">[gist URL]</div>
Örnek: <div class="gist">https://gist.github.com/1395926</div>
-->
@bryceadams
bryceadams / gist:3883059
Created October 13, 2012 03:05
Flexslider Parameters
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
animation: "fade", //String: Select your animation type, "fade" or "slide"
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
reverse: false, //{NEW} Boolean: Reverse the animation direction
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
startAt: 0, //Integer: The slide that the slider should start on. Array notati