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 waitForKintone(success, error, timeout) { | |
const startAt = new Date().getTime(); | |
function recursive() { | |
if (window.hasOwnProperty('kintone')) { | |
console.log("has kintone"); | |
func(); | |
} else if (new Date().getTime() - startAt > timeout) { | |
console.log("not has kintone"); | |
error(); |
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 | |
print_primes() { | |
for i in `seq 6 $1`; do | |
test=$(echo $i | factor | awk 'NF==2{print $2}') | |
if [ -n "$test" ]; then | |
echo $i | |
fi | |
done | |
} |
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
<style> | |
.popup { | |
position: relative; | |
left: 32px; | |
right: 32px; | |
bottom: 32px; | |
background-color: #333; | |
color: white; | |
position: fixed; | |
padding: 16px; |
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 <iostream> | |
#include <chrono> | |
#include <thread> | |
#include <vector> | |
#include <cstdio> | |
constexpr std::chrono::milliseconds operator""_tick(unsigned long long int tick) { | |
return std::chrono::milliseconds(tick * 200); | |
} |
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 | |
value=$(dialog --rangebox 'Gamma' 10 72 -10 10 0 2>&1 >/dev/tty) | |
[[ $? -ne 0 ]] && exit 1 | |
gamma=$(python -c "print(10 ** ($value / 10))") | |
xgamma -gamma $gamma | |
xgamma 2>&1 | cut -f 10 -d' ' |
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); | |
}); | |
}); | |
}); |
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
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
#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
#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...>) { |