Skip to content

Instantly share code, notes, and snippets.

View jaspertandy's full-sized avatar

Jasper jaspertandy

View GitHub Profile
import { Controller } from "stimulus"
export default class extends Controller {
// this method is called when Stimulus attaches this
// class to an instance of a controller. It's like a
// constructor but I think it's when all the setup is done
// and we're ready to get started. That's how I use it anyway!
connect() {
this.updating = false // by default, we're not updating anything
this.timer = false // when updating on keypresses, we only do this on a timeout to reduce the number of requests sent
<div style="background-color:#fff;display:inline-block;font-family:'Helvetica Neue',Arial,sans-serif;color:#a7a7a7;font-size:11px;width:100%;"><div style="overflow:hidden;position:relative;height:0;padding:150.379747% 0 49px 0;width:100%;"><iframe src="//embed.gettyimages.com/embed/169192857?et=AeJi6xj_SahLhQXgfsPJNw&sig=bmxaxNpmY6oNWL47DUU59EY6JO7S5y49kZNtWEsGRII=" width="398" height="655" scrolling="no" frameborder="0" style="display:inline-block;position:absolute;top:0;left:0;width:100%;height:100%;"></iframe></div><p style="margin:0;"></p><div style="padding:0;margin:0 0 0 10px;text-align:left;"><a href="http://www.gettyimages.com/detail/169192857" target="_blank" style="color:#a7a7a7;text-decoration:none;font-weight:normal !important;border:none;">#169192857</a> / <a href="http://www.gettyimages.com" target="_blank" style="color:#a7a7a7;text-decoration:none;font-weight:normal !important;border:none;">gettyimages.com</a></div></div>
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[**.js]
indent_style = tab
// -------------------------------------
// if some butthead doesn't return
// the array from their extension
// we need a backup here or everything
// busts.
// -------------------------------------
@jaspertandy
jaspertandy / mcp.freeform.php
Created September 13, 2013 16:50
in method edit_entry()
if ($form_data['field_order'] !== '')
{
$order_ids = $this->actions()->pipe_split($form_data['field_order']);
if ( ! empty($order_ids))
{
//this makes sure that any fields in 'fields' are in the
//order set as well. Will add missing at the end like this
$field_loop_ids = array_merge(
$order_ids,
@jaspertandy
jaspertandy / Freeform_notifications.php
Created September 13, 2013 16:48
In method send_notification() at line 309
if ( ! empty($order_ids))
{
//this makes sure that any fields in 'fields' are in the
//order set as well. Will add missing at the end like this
$field_loop_ids = array_merge(
$order_ids,
array_diff($field_loop_ids, $order_ids)
);
} else {
$layout = $this->composer_field_order( $form_data['form_id'] );
@jaspertandy
jaspertandy / mcp.freeform.php
Created September 13, 2013 16:46
in method visible_columns()
$default_hide = array('site_id', 'entry_id', 'complete');
foreach ($default_hide as $hide_me_seymour)
{
if (in_array($hide_me_seymour, $visible_columns))
{
unset(
$visible_columns[
array_search(
$hide_me_seymour,
public function composer_field_order( $form_id ){
$composer = ee()->db->select('composer_id')
->where('form_id' , $form_id)
->get('freeform_forms')
->row()
->composer_id;
$layout = ee()->db->select('composer_data')
->where('composer_id' , $composer)
->get('freeform_composer_layouts')
word count
going 1081
love 1055
much 759
need 725
thing 705
something 695
fucking 687
right 669
great 667
#!/usr/bin/env ruby
require 'nokogiri'
file = File.expand_path '~/../Dropbox/Public/2012.xml'
xml = Nokogiri::XML( File.new( file ) );
albums = xml.xpath '//key[. = "Album"]'
all = []