Uncaught TypeError: Cannot set property 'onclick' of null at (index):1
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 node | |
const fs = require('fs'); | |
const csvLine = require('csv-line'); | |
const readFile = function(file) { | |
return new Promise(function(resolve, reject) { | |
fs.readFile(file, 'utf8', function(err, data) { | |
err ? reject(err) : resolve(JSON.parse(data)); | |
}); |
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
const Chai = require('chai'); | |
const Spies = require('chai-spies'); | |
Chai.use(Spies); | |
const original = function(callback) { | |
setTimeout(callback, 0); | |
}; | |
it("async callback should be called with Spy", function() { |
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
#!/bin/bash | |
# Copy into /usr/local/bin/benchmark | |
# Give permissions: chmod +x /usr/local/bin/benchmark | |
# Usage: `benchmark http://example.com` | |
ab -n20 -c1 $1 | grep 'Requests per second\|Time per request\|Transfer rate\|Total transferred' |
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
<?php | |
/** | |
* Uninstall modules. | |
*/ | |
function foo_update_7001() { | |
module_disable(array('module1', 'module2')); | |
drupal_uninstall_modules(array('module1', 'module2')); | |
} |
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
angular.config(function($urlRouterProvider, $stateProvider) { | |
$stateProvider.state('404Page', { template: '404' }); | |
$urlRouterProvider.otherwise(function($injector, $location) { | |
$injector.get('$state').go('404Page', {}, { location: false }); | |
return $location.path(); | |
}); | |
}); |
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
[ | |
{ "keys": ["super+shift+backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }, | |
{ "keys": ["super+d"], "command": "duplicate_line" }, | |
{ "keys": ["super+shift+up"], "command": "swap_line_up" }, | |
{ "keys": ["super+shift+down"], "command": "swap_line_down" }, | |
{ "keys": ["super+shift+n"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, | |
{ "keys": ["super+shift+alt+n"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} }, |
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
#!/bin/bash | |
USER='root' | |
PASS='root' | |
DATABASE='drupal' | |
# Create folders if it's not yet. | |
mkdir -p ~/backups/{database,files} | |
# Backup. |
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
var express = require('express'), | |
request = require('request'); | |
var app = express(); | |
// Forward all requests from /api to http://foo.com/api | |
app.use('/api', function(req, res) { | |
req.pipe(request("http://foo.com/api" + req.url)).pipe(res); | |
}); |
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
# New Year | |
59 23 31 12 * mplayer http://happy-year.narod.ru/mp3/kurant.mp3 | |
0 0 1 1 * mplayer http://media.kremlin.ru/1999_12_31_01s.mp3 | |
# Every morning - Chill Out (7:00 - 9:00) | |
0 7 * * 1-5 mplayer http://air2.radiorecord.ru/chil_320 | |
0 9 * * 1-5 pkill mplayer | |
# Every evening - Chill Out (19:00 - 22:00) | |
0 19 * * 1-5 mplayer http://air2.radiorecord.ru/chil_320 |
NewerOlder