Skip to content

Instantly share code, notes, and snippets.

View carbontwelve's full-sized avatar
🎯
Focusing

Simon Dann carbontwelve

🎯
Focusing
View GitHub Profile
@brettz9
brettz9 / String-test.html
Created November 10, 2012 05:46
Shim to allow array-like access on "new String()" characters
<!-- Add our shim to support array-like accessors on
String objects (i.e., those invoked with new String()) -->
<script src="String.js"></script>
<script>
// Regular string literals or String() invoked without 'new' will
// behave the same as without the shim in all browsers (i.e.,
// accessors are not supported in IE < 9)
var str = 'abc';
@wdmtech
wdmtech / AnonymousComponent.vue
Last active January 25, 2017 16:17
A Vue 2.0 component template
<template>
<span>
</span>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
name: 'anonymous-component',
@tkarpinski
tkarpinski / web.config
Created January 16, 2012 14:43
webconfig for http to https redirect
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
@carbontwelve
carbontwelve / wordsmith.css
Last active December 17, 2019 18:05
increment.com inspired css for writefreely
body {
background-color: #efefef;
}
/* Blog header on index and post pages */
#blog-title a {
color: #fff;
background-color: #7a629d;
padding: 0.5em;
display: inline-block;
@0x263b
0x263b / slack_logs.rb
Last active March 9, 2020 00:56
Obtain channel logs from Slack's API
#!/usr/bin/env ruby
# encoding: utf-8
# Uses the following Slack API methods:
# user.list → https://api.slack.com/methods/users.list
# channels.history → https://api.slack.com/methods/channels.history
require "open-uri"
require "json"
# Obtain a token
//EnhanceJS isIE test idea
//detect IE and version number through injected conditional comments (no UA detect, no need for cond. compilation / jscript check)
//version arg is for IE version (optional)
//comparison arg supports 'lte', 'gte', etc (optional)
function isIE(version, comparison) {
var cc = 'IE',
b = document.createElement('B'),
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
)
@sukei
sukei / Signal.php
Last active August 24, 2021 11:08
An Observer in a Tweet
<?php
/**
* The Signal class is the smallest and fastest observer written in PHP 5.6 and
* using some new features such as the variadic functions and the arguments
* unpacking.
*
* ...and it fits in a tweet.
*
* @author Quentin Schuler aka Sukei <qschuler@neosyne.com>
@Phate6660
Phate6660 / lobsters-dark.css
Last active January 16, 2022 08:42
A dark userstyle for https://lobste.rs that aims to be simple and robust.
body, textarea, input, button {
font-size: 11px;
}
a {
color: green;
}
p>a {
color: green !important;