Skip to content

Instantly share code, notes, and snippets.

View remy's full-sized avatar
🐹
Always hacking

Remy Sharp remy

🐹
Always hacking
View GitHub Profile
@remy
remy / noswear.js
Last active September 10, 2018 15:06 — forked from WebReflection/noswear.js
no swear
var terms = ['shit', 'fuck'].map(s => ' ' + s + ' ');
var re = RegExp(terms.join('|'));
var hasBadWords = function (str) { return re.test(' ' + str + ' '); };
hasBadWords("hit me duck"); // false
hasBadWords("holy shit"); // true
hasBadWords("My assistant couldn't find shitake mushrooms."); // false
@remy
remy / example.js
Last active August 29, 2015 13:56 — forked from sidorares/gist:9181766
node --expose_debug_as=v8debug example.js
function bbb(x) {
var cc = x + 1;
var dd = cc + 2;
JSON.parse("remy"); // causes exception
return dd;
}
setInterval(function() {
var aa = 123;
try {
@remy
remy / sampled.js
Created December 10, 2012 14:29 — forked from benfoxall/sampled.js
function sampled(arr, size) {
var sampled = [], i, n, idx, l = arr.length;
if (arr.length <= size){
return arr
} else {
for (i = 0; i < size; i++) {
n = (i / size) * l;
// faster Math.ceil (because I'm doing this with large arrays inside raf)
idx = (n << 0);
idx = (idx == n)? idx: idx + 1;
@remy
remy / gist:3103659
Created July 13, 2012 08:30 — forked from paulirish/gist:3098860
Open Conference Expectations

Open Conference Expectations

Treat others as you'd expect to be treated. Don't be a dick. We're looking at both you the organiser and you the speaker.

Thanks,

- The Community.

@remy
remy / dabblet.css
Created February 26, 2012 15:38 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
@remy
remy / dabblet.css
Created February 26, 2012 15:38 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
@remy
remy / dabblet.css
Created February 26, 2012 15:38 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
(function() {
var css = [
'/css/default.css',
'/css/section.css',
'/css/custom.css'
],
i = 0,
link = document.createElement('link');
link.rel = 'stylesheet',
head = document.getElementsByTagName('head')[0],
// Provides a device_scale class on iOS devices for scaling user
// interface elements relative to the current zoom factor.
//
// http://37signals.com/svn/posts/2407-device-scale-user-interface-elements-in-ios-mobile-safari
// Copyright (c) 2010 37signals.
//
// 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
@remy
remy / demo.html
Created June 3, 2010 20:32 — forked from njonsson/demo.html
Just a refactor for njonsson - Example seen here: http://jsbin.com/ayoxa4/2
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>
passwordComplexity jQuery plugin demo
</title>
<style type='text/css'>
* {
font-family: Helvetica, Arial, sans-serif;