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
// examples: | |
// makePermissionDescription'oneTwoThree') == 'one two three' | |
// makePermissionDescription('hasFooBarXYZ') == 'foo bar XYZ' | |
// makePermissionDescription('isFOOBar') == 'is FOO bar' | |
// Note: output is meaningful only for inputs that consists only of letters | |
const splitByUpperCase = keyName => { | |
const words = []; | |
let desc = keyName.replace(/^can/, ''); | |
let loops = 4096; |
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 | |
# example usage: | |
# ./add-monitor-resolution.sh VGA-1 1920 1080 | |
# Note: replace VGA-1 with the name of your device | |
# run `xrandr --list-monitors` to see the name of your device | |
monitor=$1 | |
width=$2 | |
height=$3 | |
modeline=`cvt $width $height | tail -n1 | cut --complement -d" " -f 1` |
This file has been truncated, but you can view the full file.
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
{ | |
"XMLBIBLE": { | |
"$": { | |
"version": "2.0.1.22", | |
"p1:noNamespaceSchemaLocation": "zef2005.xsd", | |
"biblename": "Svenska Folkbibeln (1998)", | |
"type": "x-bible", | |
"status": "v", | |
"revision": "0", | |
"xmlns:p1": "http://www.w3.org/2001/XMLSchema-instance" |
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 node | |
const path = require("path"); | |
const readline = require("readline"); | |
const fs = require("fs"); | |
const logFilename = "stein.txt"; | |
const getArgv = () => { | |
const argv = process.argv.slice(0); | |
if (path.basename(argv[0]) == "node") { |
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
/** | |
Purpose: Set the size of html element to the paper size | |
Example/Usage: | |
<div class="a0 landscape"></div> | |
<div class="a4"></div> | |
<div class="letter"></div> | |
*/ |
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 | |
# Gets the main activty of the android project | |
# Run at project root folder | |
# output like: com.package.sub/com.package.sub.MainActivity | |
# Purpose: use with android am for running the installed apk | |
activity=$(cat `find app/src -iname "AndroidManifest.xml"` | grep -i '<activity android:name' | sed 's/.*="\(.*\)".*/\1/') | |
activity=$(echo $activity | sed 's/^\.//') |
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
Thu Jul 26 02:46:13 EDT 2018 | |
Tadah. I finally installed Debian 9 with Xfce4. | |
Everything is noticeably smooth and faster, | |
compared to Winlag 10. I initially tried installing | |
Debian testing, but it seems there was a problem | |
with the build (something about lvm modules not being loaded). | |
No matter, not having the latest packages from apt repository | |
shouldn't be much of a problem. |
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
awful.key({ modkey, }, "Return", | |
function () | |
pid = client.focus.pid | |
cpid = string.gsub(awful.util.pread('pgrep -P ' .. pid), "[\r\n]+$", "") | |
cwd = string.gsub(awful.util.pread('readlink /proc/' .. cpid .. '/cwd'), "[\r\n]+$", "") | |
if string.len(cwd) > 0 then | |
awful.util.spawn(terminal .. ' -cd ' .. cwd) | |
else | |
awful.util.spawn(terminal) | |
end |
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 | |
if (isset($_REQUEST["action1"])) { | |
$animal = $_REQUEST["animal"]; | |
echo "Selected animal: $animal"; | |
} | |
?> | |
<form method="POST"> | |
<select name="animal"> | |
<option value="dog">dog</option> | |
<option value="cat">cat</option> |
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
// CSS Color Names | |
// Compiled by @bobspace. | |
// | |
// A javascript array containing all of the color names listed in the CSS Spec. | |
// The full list can be found here: http://www.w3schools.com/cssref/css_colornames.asp | |
// Use it as you please, 'cuz you can't, like, own a color, man. | |
var CSS_COLOR_NAMES = {"aliceblue":1, "antiquewhite":1, "aqua":1, "aquamarine":1, "azure":1, "beige":1, "bisque":1, "black" :1, "blanchedalmond":1, "blue":1, "blueviolet":1, "brown":1, "burlywood":1, "cadetblue":1, "chartreuse":1, "chocolate":1, " coral":1, "cornflowerblue":1, "cornsilk":1, "crimson":1, "cyan":1, "darkblue":1, "darkcyan":1, "darkgoldenrod":1, "darkgray ":1, "darkgrey":1, "darkgreen":1, "darkkhaki":1, "darkmagenta":1, "darkolivegreen":1, "darkorange":1, "darkorchid":1, "dark red":1, "darksalmon":1, "darkseagreen":1, "darkslateblue":1, "darkslategray":1, "darkslategrey":1, "darkturquoise":1, "dark violet":1, "deeppink":1, "deepskyblue":1, "dimgray":1, "dimgrey":1, "dodgerblue":1, "firebrick":1, "floralwh |