Skip to content

Instantly share code, notes, and snippets.

View afc163's full-sized avatar
🎃
Closing issues

afc163 afc163

🎃
Closing issues
View GitHub Profile
manager dist manifest export ignore include entry
npm npm package.json cjs .npmignore #main
bower git bower.json umd #ignore #main
component git component.json umd #files #main
spm git package.json#spm umd .spmignore #output #main
packagist git composer.json umd
ender npm package.json cjs .npmignore #ender
dojo ??? package.json#dojoBuild umd #dojoBuild
jspm npm/git package.json#jspm any #ignore #files #main
@swider
swider / rotate.less
Created October 6, 2011 22:46
LESS Rotate Mixin for IE
.rotate(@val) {
-moz-transform: rotate(@val); /* FF3.5+ */
-o-transform: rotate(@val); /* Opera 10.5 */
-webkit-transform: rotate(@val); /* Saf3.1+, Chrome */
-ms-transform: rotate(@val); /* IE9 */
transform: rotate(@val);
/* IE6-IE8 */
@radians: ~`parseInt("@{val}") * Math.PI * 2 / 360`;
@costheta: ~`Math.cos("@{radians}")`;
@StuPig
StuPig / parrallax_library_bookmark.markdown
Created September 3, 2013 03:03
视差动画库收集 A collection of parallax scrolling library bookmarks
@ufologist
ufologist / app.js
Created June 20, 2013 07:51
RequireJS load module mechanism
require(['main'], function(main) {
main.hello();
});
@dceddia
dceddia / config-overrides.dev.js
Created December 6, 2016 21:12
Customize Create React App without ejecting
module.exports = function(config) {
// Generate sourcemaps
config.devtool = 'source-map';
// Compile i18n messages throughout the project into JSON files
config.module.loaders[0].query.plugins = [
["react-intl", {
"messagesDir": "./build/messages/"
}]
];
@chrisladd
chrisladd / text.js
Created February 9, 2016 19:56
Text Rendering for Sketch
// text.js
function replaceSubstring(inSource, inToReplace, inReplaceWith) {
var outString = inSource;
while (true) {
var idx = outString.indexOf(inToReplace);
if (idx == -1) {
break;
}
@threepointone
threepointone / deep-string.js
Last active March 13, 2019 20:09
deep update of text in a react component
import React from 'react'
import { render } from 'react-dom'
// with fiber, we'll be able to write components that update text deep
// inside another string without wrapper dom, or rerendering the whole component
// before
class Lorem extends React.Component {
state = {
str: ''
@kara-ryli
kara-ryli / MyAppDelegate.m
Created October 20, 2011 22:21
Create a device-specific identifier in Objective-C
@implementation MyAppDelegate
/**
* Generates a Universally Unique Identifier based on the time and
* hardware details of a device. CFUUIDCreate is the recommended
* way by Apple to generate an ID now that UIDevice-uniqueIdentifier
* is deprecated.
*
* Props: http://www.cocoabuilder.com/archive/cocoa/217665-how-to-create-guid.html#217668
*/
@davidhund
davidhund / feature-detect flexbox.js
Last active October 17, 2019 16:02
The simplest feature-detect for flexbox?
/*
* Trying to feature-detect (very naive)
* CSS Flexbox support.
* - Only most modern syntax
*
* Is this nonsense?
*/
(function NaiveFlexBoxSupport(d){
var f = "flex", e = d.createElement('b');
@ChristopherBiscardi
ChristopherBiscardi / gatsby.config.js
Created January 20, 2016 19:02
Extracting Stylesheets with Gatsby
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = function(config, env) {
if(env === 'static') {
config.removeLoader('css');
config.loader('css', function(cfg) {
cfg.test = /\.css$/;
cfg.loader = ExtractTextPlugin.extract('css?minimize');
return cfg
})