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
// Script to download images from WhatsApp | |
// | |
// Steps to use: | |
// 1. Open up the conversation you want to download pics from | |
// 2. Open the leftmost image you want to download (the script | |
// will download and advance to the next image until the last | |
// image is reached. | |
// 3. Open the developer console and paste the script in it | |
// 4. Click OK on the "Download multiple files" browser prompt | |
// (if it appears) |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<targets> | |
<target name="coloredConsole" xsi:type="ColoredConsole" useDefaultRowHighlightingRules="false" | |
layout="${longdate}|${pad:padding=5:inner=${level:uppercase=true}}|${message}" > | |
<highlight-row condition="level == LogLevel.Debug" foregroundColor="DarkGray" /> | |
<highlight-row condition="level == LogLevel.Info" foregroundColor="Gray" /> | |
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" /> |
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
# Usage: | |
# | |
# Run `some_app` only if 10 math puzzles are solved first: | |
# python3 compute_exercise.py && some_app | |
# | |
# Only 7 puzzles instead of the default 10: | |
# python3 compute_exercise.py 7 && some_app | |
# | |
# Only 5 puzzles, but force exit after 10min: | |
# python3 compute_exercise.py 5 && timeout 600 some_app |
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
cd ~ | |
mkdir -p ~/.config | |
sudo apt-get install -y inotify-tools | |
sudo apt-get install -y tmux | |
git clone https://github.com/clupasq/clupasq.git $HOME/.config/clupasq | |
$HOME/.config/clupasq/setup.sh -o |
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
p = self.spawnpos() | |
str="THIS IS THE MESSAGE!" | |
isx = 1 | |
isz = 0 | |
dir = -1 | |
for i = 1, #str do | |
local c = str:sub(i,i) |
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
[Test] | |
public void ComputeResultWithTimeout() | |
{ | |
var task = Task.Factory.StartNew(() => ComputeResult("bla")); | |
//task.Wait(0999); | |
task.Wait(1000); | |
if (task.IsCompleted) | |
Console.WriteLine("OK, got: " + task.Result); |
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
setxkbmap -option caps:escape,shift:both_capslock |
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
require 'rspec/autorun' | |
require 'json' | |
require 'httparty' | |
require 'pp' | |
GuessResult = Struct.new :x, :y, :count | |
class FakeGame | |
def initialize(x=random_num, y=random_num) | |
@x = x |
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
x `shouldBe` y = putStrLn $ if x == y then "OK" else "Not OK!" |
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 searchObject = function(o, expr, callback, path, visited) { | |
try{ | |
visited = visited || new Set(); | |
path = path || ''; | |
if (visited.has(o)) { return; } | |
if (!o) { return; } | |
visited.add(o); | |
if (typeof o === 'string') { | |
if (o.match(expr)) { | |
callback(path); |
NewerOlder