Skip to content

Instantly share code, notes, and snippets.

View lvbeck's full-sized avatar

Jin Lu lvbeck

  • ZUB-Systems
  • Kassel, Germany
View GitHub Profile
@lvbeck
lvbeck / gist:f5ecf7164b57f50dbed86cffb7898a6f
Last active June 13, 2019 15:18
get operations of materials
function getOperationsByMaterial(material) {
var operations_types = ["Prepare", "CutOpen", "CutOff", "Test", "CutOff", "Observe", "Summary"]; // 数组长度已知
var operations = []; // 可变长度数组
// 读入该条文本数据并得到操作集
operations = ["Prepare", "CutOpen", "CutOff", "Test", "CutOff", "Observe", "CutOff", "Test", "Summary"];
return operations;
}
function formatOperationsArray(operations) {
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
@metamatt
metamatt / QBird.js
Created June 11, 2015 23:00
Replace Angular $q with Bluebird
app.config(['$qProvider', function($qProvider) {
// Tell Angular to create Bluebird promises instead of $q promises.
$qProvider.$get = function() {
function QBird(resolver) {
return new Promise(resolver);
}
QBird.defer = function() {
var deferred = {};
deferred.promise = new Promise(function(resolve, reject) {

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@phated
phated / gist:2831051
Created May 29, 2012 21:58
JSON Serialized dojox/gfx object
[
{
"shape": {
"type": "image",
"x": -78.81720430107526,
"y": 30,
"width": 777.6344086021505,
"height": 560,
"src": "https://super_cool_url.com/images/4fc523c4fa0b3510de00000f/lightning-original.jpg?1338319812"
},
@jwage
jwage / SplClassLoader.php
Last active August 16, 2024 17:36
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,