This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import path from 'path'; | |
import fs from 'fs'; | |
const app = express(); | |
const transformCssModule = (cssFilePath, cssUrlPath, scopeId, isolated = true) => { | |
const cssContent = fs.readFileSync(cssFilePath, 'utf8'); | |
const classNames = new Set(cssContent.match(/\.[\w-_]+/g) || []); | |
let exportedClasses = `const isolated = ${isolated ? 'true' : 'false'};\nconst _styles = { $scoped: '__scoped', scoped: '__scoped', ':scoped': '__scoped', root: '__root', $root: '__root', ':root': '__root', host: '__root', $host: '__root', ':host': '__root' };\n`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env swift | |
import Foundation | |
// usage: | |
// swift xcode-sync.swift XCodeProject.xcodeproj --sync FolderToSync | |
struct ANSI { | |
// Foreground Colors | |
static let black = "\u{001B}[30m" | |
static let red = "\u{001B}[31m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.25) | |
// Compass (v1.0.3) | |
// ---- | |
//////////////////////////////////////////////////////////////////////////////// | |
// Sass Expression Eval | |
// Brant Wedel | |
// bitbased.net | |
// https://gist.github.com/brantwedel/3bba625840e247438c9770aa46881718 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h1>${message}</h1> | |
<div ref="borderDiv" click.delegate="toggleBorder()" css="${borderCss}"> | |
<h2>Click to toggle my border</h2> | |
<hr> | |
<h4>css binding:</h4> | |
<code>${borderCss}</code> | |
<hr> | |
<h4>actual style attribute:</h4> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cycle through Google Chrome tabs and windows | |
tell application "System Events" | |
set activeApp to name of first application process whose frontmost is true | |
try | |
set activeChrome to first application process whose name is "Google Chrome" | |
set appName to name of window 1 of activeChrome | |
on error errMsg | |
tell application "Google Chrome" to make new window | |
tell application "Google Chrome" to activate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name JSCUT Select All | |
// @namespace http://bitbased.net/ | |
// @version 0.1 | |
// @description Add double click select all to jscut.org | |
// @author Brant Wedel - bitbased.net | |
// @match http://jscut.org/jscut.html | |
// @grant none | |
// ==/UserScript== |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval -> | |
return if $("#footer-region").length == 0 | |
window.last_width |= 0 | |
window.last_height |= 0 | |
width = $("#footer-region").width() | |
height = $("#footer-region").offset().top + $("#footer-region").height() | |
unless window.active_input_listeners | |
window.active_input_listeners = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open and override ActiveRecord::FixtureSet with new identify method implementation to support sequentual ID's | |
module ActiveRecord | |
class FixtureSet | |
@@seq_id = 0 | |
@@seq_keys = {} | |
def self.identify(label) | |
@@seq_keys[label] ||= begin | |
@@seq_id += 1 | |
@@seq_id | |
end |