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
#Cleans up accidentally added Ubuntu repositories from the Debian's repository list | |
#!/bin/bash | |
sourcesDir=/etc/apt/sources.list.d | |
fileNames=$(ls $sourcesDir) | |
for fileName in $fileNames | |
do | |
fullFilePath=$sourcesDir/$fileName | |
fileSourcesList=$(cat $fullFilePath) | |
if [[ "$fileSourcesList" =~ "ubuntu" ]] | |
then |
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
<!-- Hosted https://output.jsbin.com/gowiruwiku/2 --> | |
<html> | |
<header> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
padding: 0; | |
background-color: black; | |
} |
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
Use folowing steps to repackage dep package: | |
1: Extract deb package | |
# dpkg-deb -x <package.deb> <dir> | |
2: Extract control-information from a package | |
# dpkg-deb -e <package.deb> <dir/DEBIAN> | |
3. After completed to make changes to the package, repack the deb | |
# dpkg-deb -b <dir> <new-package.deb> |
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 | |
#Found at http://askubuntu.com/a/193065/35729 | |
#don't forget to 'chmod +x <thisFile>' | |
sudo add-apt-repository ppa:motumedia/mplayer-daily | |
sudo add-apt-repository ppa:videolan/stable-daily | |
sudo apt-get update | |
sudo apt-get upgrade |
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
/* | |
* Demo of using Webdriver to automate browser testing. | |
* Fetches price and rating for a book from Amazon.com for a given book title. | |
* | |
* Example: | |
* | |
* node fetch.price.js SurviveJS | |
*/ | |
var webdriver = require('selenium-webdriver'), |
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
/* | |
* Demonstrates how 'combineReducers' can be implemented. | |
*/ | |
function combineReducers(reducers) { | |
return function(state, action) { | |
var reducerNames = Object.keys(reducers); | |
var combination = {}; | |
reducerNames.forEach(function(reducerName) { | |
combination[reducerName] = reducers[reducerName](state[reducerName], action); |
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
Rx.Observable.interval = function(timeout) { | |
var DEFAULT_TIMEOUT_MS = 1000; | |
timeout = timeout || DEFAULT_TIMEOUT_MS; | |
return Rx.Observable.create(function(observer) { | |
var i = 0; | |
var interval = setInterval(function() { | |
observer.onNext(i++); | |
}, timeout); | |
}); |
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
//JavaScript swapping variables | |
var x = 1, y = 2; | |
[x, y] = [y, x]; | |
console.log("x = %s, y = %s", x, y); |
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
//Based on the demo https://gist.github.com/wesbos/cd16b8b1815825f111a2 | |
(function(host) { | |
if (typeof speechSynthesis === 'undefined') { | |
console.warn('No speech syntesis feature available,' | |
+ 'calls to "say" will be ignored, try latest Google Chrome'); | |
host.say = function() {}; | |
return; | |
} |
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/local/bin/python | |
# Linux utility for archiving Github.com repositories for a given account. | |
# | |
# Example usage: | |
# | |
# python archive_github_account.py antivanov ~/src/my-src | |
# | |
import sys |