Skip to content

Instantly share code, notes, and snippets.

View sunny's full-sized avatar
☀️

Sunny Ripert sunny

☀️
View GitHub Profile
class BlackHoleStore
def logger
Rails.logger
end
def fetch( *args )
yield
end
def read( *args )
#####
##### Easily enable clearType on windows.
#####
*** WHAT IT DOES ***
It asks the user to install an activex control, signed by microsoft.
This activex control allows cleartype options to be set using javascript.
@theamnesic
theamnesic / sunnytize.php
Created July 12, 2011 13:12 — forked from sunny/sunnytize.php
WordPress plugin that removes evil characters in file names
<?php
/*
Plugin Name: Sunnytize
Plugin URI:
Description: A better file name sanitizer
Version: 1.0
Author: Sunny Ripert
Author URI: http://sunfox.org
*/
@mirisuzanne
mirisuzanne / fontface.scss
Created June 4, 2012 18:05
Naming convention for new Compass @font-face API
// New fontface naming conventions & API
// File Structure
//
// - fonts_dir/ [config setting]
// - simple.eot
// - simple.svg
// - simple.ttf
// - simple.woff
// - folder/
@Ynote
Ynote / dot-css-dot-js.md
Created November 10, 2018 11:28
[Conferences] Some thoughts about DotCSS and DotJS 2018

About DotJS and DotCSS 2018

This year, I preferred DotCSS to DotJS. Some talks were amazing and inspiring. The atmosphere was kind and I talked to some speakers ! (@frivoal, @natalyathree AAAANNNND @SaraSoueian <3 <3).

DotCSS

About text wrapping and line-breaking

This talk was done by Florian Rivoal. He describes some new features to handle line-breaks and text-wrapping better. Some are already implemented in some browsers, some not. What I noted :

  • Whitespace CSS rules (pre, preline, etc.) use several steps to deal with whitespace.
@hoverlover
hoverlover / savon_client.rb
Created March 19, 2012 14:45
Using my forks of Akami and Savon to sign a request with a X.509 certificate. See https://github.com/genuitytech/akami and https://github.com/genuitytech/savon.
client = Savon::Client.new do
# This can be a URL also
wsdl.document = "/Path/to/your.wsdl"
# These are optional, only if your WSDL sucks :)
wsdl.endpoint = "https://your_endpoint"
wsdl.namespace = "http://your_namespace"
certs = Akami::WSSE::Certs.new :cert_file => "/path/to/cert.crt", :private_key_file => "/path/to/private/key.pem", :private_key_password => "password"
wsse.sign_with = Akami::WSSE::Signature.new certs
@scmx
scmx / react-proptype-warnings-as-errors-with-sinon.markdown
Last active March 1, 2019 08:42
Make React PropType warnings throw errors with mocha.js, enzyme.js and sinon.js

Make React PropType warnings throw errors with enzyme.js + sinon.js + mocha.js

A simple stateless functional component that we want to test that it renders without propType warnings.

import React, { PropTypes } from 'react'

let VersionListItem = function ({ active, version }) {
  return (
@sunny
sunny / enumerator_lazy_compact_extension.rb
Last active September 7, 2019 16:16
Adds #compact to Lazy Enumerators in Ruby
class Enumerator::Lazy
def compact
reject(&:nil?)
end
end

Snow in canvas land

Other people's code is awful, and your own code from months previous counts as someone else's. With this and the festive spirit in mind, I dug up a canvas snow demo I made two years ago to see how bad my code really was.

Turns out the performance landscape has changed quite a bit, but after applying a couple of workarounds, best practices, and memory management, I got the demo running smoother than it ever did.

Ugh, I can't believe I just wrote "performance landscape". Anyway...

How does the demo work?