This file contains hidden or 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
var abbr = 'ul>li*3>h2+p*2'; | |
try | |
{ | |
// expands abbreviation and inject results into 'my-element' | |
$('my-element').expandAbbreviation(abbr); | |
// returns an Elements object | |
var elements = ZenCoding.abbrToElements(abbr); | |
// expands abbreviation to an html string | |
var my_string = String.expandAbbreviation(abbr); | |
} |
This file contains hidden or 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
#! /bin/bash | |
# Edit /etc/sudoers to allow all users to shutdown and reboot without password | |
# Your previous sudoers file will be backed as /etc/sudoers.bak | |
sudo sed -i.bak -e '$ a\ | |
ALL ALL=\(ALL\) NOPASSWD: /sbin/shutdown, sbin/reboot | |
' /etc/sudoers |
This file contains hidden or 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
#! /bin/bash | |
USERS=($(cat /etc/passwd | grep /home/ | grep -v /bin/false | cut -d : -f 1)) | |
ALIAS=$(printf ",%s" "${USERS[@]}") | |
PATTERN="$ a\ | |
${ALIAS:1} ALL=\(ALL\) NOPASSWD: /sbin/shutdown, /sbin/reboot | |
" | |
# Edit /etc/sudoers to allow all physical users to shutdown and reboot without password | |
# Your previous sudoers file will be backed as /etc/sudoers.bak | |
sudo sed -i.bak -e "$PATTERN" /etc/sudoers |
This file contains hidden or 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
#! /bin/bash | |
PATTERN="$ a\ | |
$(whoami) ALL=\(ALL\) NOPASSWD: /sbin/shutdown, /sbin/reboot | |
" | |
# Edit /etc/sudoers to allow current user to shutdown and reboot without password | |
# Your previous sudoers file will be backed as /etc/sudoers.bak | |
sed -i.bak -e "$PATTERN" /etc/sudoers |
This file contains hidden or 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
<?php | |
require 'Benchmark/Timer.php'; | |
$timer = new Benchmark_Timer(); | |
$nb_iterations = 1000; | |
/** | |
* BOOTSTRAP | |
**/ |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<doctrine-mapping | |
xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | |
xsi="http://www.w3.org/2001/XMLSchema-instance" | |
schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping | |
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> | |
<entity name="Application\Sonata\MediaBundle\Entity\Media" | |
table="media__media"> |
This file contains hidden or 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var mat4 = require('gl-mat4'); | |
var interpolator = require('mat4-interpolator'); | |
var inherits = require('inherits'); | |
// | |
// Inlining mat4-css-parse & mat4-css-stringify here since RequireBin fails requiring them... | |
// nrmaliy we would just do | |
// var parseMatrix = require('mat4-css-parse'); |
This file contains hidden or 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var mat4 = require('gl-mat4'); | |
var interpolator = require('mat4-interpolator'); | |
var inherits = require('inherits'); | |
// | |
// Inlining mat4-css-parse & mat4-css-stringify here since RequireBin fails requiring them... | |
// nrmaliy we would just do | |
// var parseMatrix = require('mat4-css-parse'); |
This file contains hidden or 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
#!/bin/bash | |
if [[ ! -d "$1" ]]; then | |
echo "Not a directory: $1" | |
exit 1 | |
fi | |
find "$1" -type f | while read name | |
do | |
./php-src/sapi/cli/php ./words.php "$2" < "$name" >/dev/null |
This file contains hidden or 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 bash | |
# Author: Sasha Nikiforov | |
# source of inspiration | |
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions | |
# Detect platform | |
if [ "$(uname)" == "Darwin" ]; then | |
# MacOS |
OlderNewer