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
listviewitems.map(item => item.id).filter(id => Number.isInteger(id)).map(id => 'i:' + id).join(',') |
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 | |
sudo iptables --append OUTPUT -s 52.0.16.118 -j DROP | |
sudo iptables --append OUTPUT -s 52.1.147.205 -j DROP | |
sudo iptables --append OUTPUT -s 52.1.119.170 -j DROP | |
sudo iptables --append OUTPUT -s 52.1.173.203 -j DROP | |
sudo iptables --append OUTPUT -s 52.4.145.119 -j DROP | |
sudo iptables --append OUTPUT -s 52.4.175.111 -j DROP | |
sudo iptables --append OUTPUT -s 52.4.225.124 -j DROP | |
sudo iptables --append OUTPUT -s 52.4.240.221 -j DROP |
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 | |
LAPTOP=DP-0 | |
TOP=HDMI-0 | |
LEFT_INNER=DP-4 | |
LEFT_OUTER=DP-2 | |
xrandr --output "${TOP}" --primary --auto \ | |
--output "${LEFT_INNER}" --right-of "${LEFT_OUTER}" \ | |
--output "${TOP}" --right-of "${LEFT_INNER}" \ |
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
#!/usr/bin/env python3 -tt | |
from winreg import * | |
def software_path(program_key): | |
key = OpenKey(ConnectRegistry(None, HKEY_LOCAL_MACHINE), f'SOFTWARE\{program_key}') | |
for i in range(QueryInfoKey(key)[1]): | |
try: | |
subkey = EnumValue(key, 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
// ==UserScript== | |
// @name GitHub Logo to Profile | |
// @version 0.1 | |
// @description Make the main octocat logo take me to my profile for faster navigation | |
// @author Pachonk | |
// @match https://github.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { |
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
#! /usr/bin/env bash | |
cd /tmp | |
wget https://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-x64.tar.xz | |
tar xf node-v6.10.3-linux-x64.tar.xz | |
cd node-v6.10.3-linux-x64 | |
cp bin/node /usr/local/bin/ | |
cp lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm |
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
libmegaADK_Adafruit_RA8875.a(Adafruit_RA8875.cpp.obj): In function `Adafruit_RA8875::Adafruit_RA8875(unsigned char, unsigned char)': | |
/home/alex/Code/adafruit-test/libraries/Adafruit_RA8875/Adafruit_RA8875.cpp:667: undefined reference to `Adafruit_GFX::Adafruit_GFX(int, int)' | |
libmegaADK_Adafruit_RA8875.a(Adafruit_RA8875.cpp.obj):(.rodata._ZTV15Adafruit_RA8875[vtable for Adafruit_RA8875]+0xa): undefined reference to `Adafruit_GFX::startWrite()' | |
libmegaADK_Adafruit_RA8875.a(Adafruit_RA8875.cpp.obj):(.rodata._ZTV15Adafruit_RA8875[vtable for Adafruit_RA8875]+0xc): undefined reference to `Adafruit_GFX::writePixel(int, int, unsigned int)' | |
libmegaADK_Adafruit_RA8875.a(Adafruit_RA8875.cpp.obj):(.rodata._ZTV15Adafruit_RA8875[vtable for Adafruit_RA8875]+0xe): undefined reference to `Adafruit_GFX::writeFillRect(int, int, int, int, unsigned int)' | |
libmegaADK_Adafruit_RA8875.a(Adafruit_RA8875.cpp.obj):(.rodata._ZTV15Adafruit_RA8875[vtable for Adafruit_RA8875]+0x10): undefined reference to `Adafruit_GFX::writeFastVLine(int, |
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
# It should be noted that the OP requested this to | |
# work in a way that allows for ANY combination of | |
# words, not just the Boggle Standard rules | |
def include?(word) | |
word.upcase! | |
board.flatten! | |
word.each_char do |c| | |
return false unless board.include?(c) | |
board.delete_at(board.index(c)) |
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
class ApplicationController < ActionController::Base | |
# this addition might/might not be needed. Try it without first. | |
before_action :configure_permitted_parameters, if: :devise_controller? | |
def configure_permitted_parameters | |
devise_parameter_sanitizer.for(:account_update) { |u| | |
u.permit(:password, :password_confirmation, :current_password) | |
} | |
end | |
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
# First install xclip (if debian based, apt-get install xclip should work) | |
# Add to .bashrc or .zshrc | |
function stopwatch() ( | |
trap 'ctrl_c $1' INT | |
function ctrl_c() { | |
echo -n "#$1 work Development $(date -u --date @$((`date +%s` - $date1)) +%-Hh%-Mm)" | xclip -sel clip | |
echo "\n\n#$1 work Development $(date -u --date @$((`date +%s` - $date1)) +%-Hh%-Mm) was sent to your clipboard." | |
exit | |
} | |
date1=`date +%s`; |