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
(function (query) { | |
engines = { | |
'g' : function (q) { return 'https://www.google.com/search?q=' + q }, | |
'd' : function (q) { return 'https://duckduckgo.com/?q=' + q }, | |
'y' : function (q) { return 'http://search.yahoo.com/search?p=' + q }, | |
'w' : function (q) { return 'http://en.wikipedia.org/wiki/' + q }, | |
't' : function (q) { return 'https://twitter.com/search?q=' + q }, | |
'b' : function (q) { return 'http://www.bing.com/search?q=' + q }, | |
}; | |
defEngine = Object.keys(engines)[0]; |
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
<!DOCTYPE HTML> | |
<html style='background-color:gray'> | |
<head> | |
<style> | |
* { | |
margin:0; | |
padding:0; | |
font-family: 'AppleGothic'; | |
} | |
.container { |
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/sh | |
base=(/sys/class/power_supply/BAT* ) | |
base=${base[0]} | |
if [ ! -d $base ]; then | |
echo 'Battery is not detected.' 1>&2 | |
exit 1; | |
fi | |
now=`cat ${base}/energy_now` | |
full=`cat ${base}/energy_full` |
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
#include <tuple> | |
#include <iostream> | |
template <typename Tuple, size_t ...xs> | |
constexpr auto sub_tuple(const Tuple &t, std::index_sequence<xs...>) { | |
return std::make_tuple(std::get<xs>(t)...); | |
} | |
template <typename Tuple, size_t x, size_t ...xs> | |
constexpr auto sub_tail_tuple(const Tuple &t, std::index_sequence<x, xs...>) { |
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
#include <functional> | |
#include <vector> | |
#include <iostream> | |
template <typename T> | |
class Array { | |
public: | |
Array(const std::initializer_list<T> &data) | |
: each(*this), keep_if(*this), data(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
diff --git a/man/synaptics.man b/man/synaptics.man | |
index 03f18ac..5f9702a 100644 | |
--- a/man/synaptics.man | |
+++ b/man/synaptics.man | |
@@ -228,6 +228,7 @@ l l. | |
0 Touchpad is enabled | |
1 Touchpad is switched off | |
2 Only tapping and scrolling is switched off | |
+3 Only pointer motion is switched off | |
.TE |
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/ruby | |
def add_host(host, options = {}) | |
puts "Host #{host}" | |
options.each do |k, v| | |
puts "#{k} #{v}" | |
end | |
puts | |
end |
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
/* | |
* What's this ? | |
* ============= | |
* | |
* This is a test program for 3D controller using a `SlimBlade` produced | |
* by Kensinton. For detail of SlimBlade, see the following URL : | |
* http://www.kensington.com/kensington/us/us/p/1444/K72327US/slimblade™-wired-media-trackball.aspx | |
* | |
* You can rotate displaied 3D object by using your SlimBlade. If you | |
* don't have SlimBlade, you can use your mouse device and its wheel. |
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 | |
## Put a pixel at (x,y). Position x and y are given by argument $1 | |
## and $2. The color of the pixel is given by $3, which runs 0 - 7 | |
function putPixel { | |
if [ $# -lt 3 ]; then | |
echo too few arguments >&2 | |
return 1 | |
fi | |
x=`echo "$1 * 2" | bc` |
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
describe('Electron renderer process', function() { | |
describe('document object', function() { | |
it('is an Document object', function() { | |
expect(window.document).to.be.an.instanceof(Document); | |
}); | |
}); | |
}); |
OlderNewer