Skip to content

Instantly share code, notes, and snippets.

@The-Quill
The-Quill / easypeasy.jsx
Created June 26, 2016 19:14
Easy < head > element with react
import React from 'react'
import Defaults from '../defaults'
const Head = React.createClass({
render(){
return <head>
<title>{Defaults.website_name}</title>
{
Defaults.stylesheets.map((file, key) => <link href={file.src} key={key} />)
}
- Grabbed 98 posts from meta.sound
- Grabbed 88 posts from meta.italian
- Grabbed 78 posts from meta.ebooks
- Grabbed 80 posts from meta.poker
- Grabbed 42 posts from meta.craftcms
- Grabbed 22 posts from meta.cs50
- Grabbed 90 posts from meta.expatriates
- Grabbed 90 posts from meta.ham
- Grabbed 87 posts from meta.sustainability
- Grabbed 38 posts from meta.rus
@The-Quill
The-Quill / sneaky_links.user.js
Last active May 27, 2016 03:52
See sneaky punctuation links
int cats = 40000;
const int dogs = cats;
cats = 39999;
[ { Name: 'dogs',
Type:
{ Character: 'int',
Type: [Object],
State: [Object],
KeywordType: [Object],
<?php
class ViewManager {
function __construct(){
include 'views/header.html';
include 'views/navbar.html';
}
private function resolveViewName($viewName){
return $viewName; // will fix viewNames and check for bad attempts
}
private function finishContent(){
@The-Quill
The-Quill / test.js
Last active June 15, 2016 03:41
Symbol.toPrimitive manipulation
var obj = {
[Symbol.toPrimitive](hint) {
if (hint == "number") {
return Object.keys(this).length;
}
if (hint == "string") {
return JSON.stringify(this);
}
},
key: 'value',
@The-Quill
The-Quill / nodeletedmessages.user.js
Created March 20, 2016 07:57
Show no deleted messages in CHQ
// ==UserScript==
// @name No Deleted Messages
// @description No deleted messages
// @version 0.0.1
// @match http://chat.stackexchange.com/rooms/11540/charcoal-hq
// @author The-Quill
// @run-at document-end
// ==/UserScript==
function hideMessage(message){
var messageBlock = message.parentNode.parentNode;
@The-Quill
The-Quill / PPCGswagusers.txt
Created February 23, 2016 20:26
Users getting PPCG swag
Martin Büttner
Dennis
Sp3000
Digital Trauma
Doorknob
Calvin's Hobbies
xnor
Peter Taylor
isaacg
marinus

i=1e300;for(;;i-->0){while(i&&alert('foo'));}

  • define i in the loop
  • use the var keyword to define variables (or let, when using for loop iterator variables)
  • i-->0 i is not how you make an ascii bow in javascript, D works better: D--> D -->0 (but seriously, write it properly. same effect)
  • while(i&amp;&amp;alert('foo') wouldn't this be slimmer if you put the alert in the loop? while(i)alert('foo')

Yes, yes it does.

:p

You actually can't. This doesn't do what it looks like (precedence).

You can reverse the condition, it just would need a little editing

It does :D