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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > $HOME/Desktop/screen.png |
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
RESTORE_FILE=file/to/restore | |
git checkout $(git rev-list -n 1 HEAD -- "$RESTORE_FILE")^ -- "$RESTORE_FILE" |
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
Configuration based on current compiler | |
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") | |
# using Clang | |
set(COMPILER_NAME "Clang") | |
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | |
# using GCC | |
set(COMPILER_NAME "GCC") | |
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") | |
# using Intel C++ | |
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") |
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
git mv -f File file |
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(CMakeParseArguments) | |
# Function to wrap a given string into multiple lines at the given column position. | |
# Parameters: | |
# VARIABLE - The name of the CMake variable holding the string. | |
# AT_COLUMN - The column position at which string will be wrapped. | |
function(WRAP_STRING) | |
set(oneValueArgs VARIABLE AT_COLUMN) | |
cmake_parse_arguments(WRAP_STRING "${options}" "${oneValueArgs}" "" ${ARGN}) |
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
case "$(uname)" in | |
Linux) export MY_PLATFORM="linux"; | |
;; | |
Darwin) export MY_PLATFORM="osx"; | |
[[ -e "/usr/local/bin/brew" ]] && export PATH=/usr/local/bin:$PATH #Homebrew | |
;; | |
CYGWIN*) export MY_PLATFORM="windows"; | |
;; | |
esac |
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 | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
# black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
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
ack -l 'PATTERN' | xargs perl -pi -E 's#PATTERN#REPLACEMENT#g' | |
ack -lQ '${PATTERN}' | xargs perl -pi -E 's#\${PATTERN}#\${REPLACEMENT}#g' |
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 | |
function meow() { | |
local CURRENT_VOLUME=$(osascript -e 'output volume of (get volume settings)') | |
osascript -e "set volume output volume 50" | |
say -v Kathy meow | |
osascript -e "set volume output volume \"${CURRENT_VOLUME}\"" | |
} |
NewerOlder