Skip to content

Instantly share code, notes, and snippets.

IP=`curl -s https://www.IPChicken.com | egrep -iEo "([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)" | head -n 1`
if [[ "$IP" = "10.0.0.1" ]];
then
echo -e "IP IS THE SAME $IP"
else
echo -e "\e[31m IP IS NOW $IP WHICH IS DIFFERENT \e[0m"
fi
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as PropTypes from 'prop-types';
const styleObj = PropTypes.shape({
color: PropTypes.string,
fontSize: PropTypes.number
});
interface ButtonProps {
# implementation of RFC 4648 using extended hex alphabet
# https://tools.ietf.org/html/rfc4648#page-10
# Used by golang in a number of places but doesn't seem to
# exist in the standard library.
encodeHex = "0123456789ABCDEFGHIJKLMNOPQRSTUV"
decodeHexMap = {}
for index, i in enumerate(encodeHex):
decodeHexMap[i] = index
//my config file
var padding = 4;
var pushRight = slate.operation("push", {
"direction" : "right",
"style" : "bar-resize:screenSizeX/2"
});
var pushLeft = slate.operation("push", {
/*
Copyright [2014] [Graham Abbott <graham.abbott@gmail.com>]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
// This is likely to break, because I'm sure a gmail update will change some of the tags,
// but it's helpful if people have special css classes on their emails.
function removeChildStyles(dom_element) {
dom_element.style = null;
for(var index=0; index < dom_element.children.length; index++) {
removeChildStyles(dom_element.children[index]);
}
}
@graham
graham / code_search.bash
Last active December 6, 2015 13:33
Code Search with Bash
function ga_code_search() {
# alias todo='ga_code_search "TODO\(`whoami`\)"'
SCREEN_WIDTH=`stty size | awk '{print $2}'`
SCREEN_WIDTH=$((SCREEN_WIDTH-4))
# Given a spooky name so you can alias to whatever you want.
# (cs for codesearch)
# AG is WAY faster but requires a binary
# (try brew install the_silver_searcher)
{
"version":"2.0",
"metadata":{
"apiVersion":"2015-03-31",
"endpointPrefix":"apigateway",
"serviceFullName":"API Gateway",
"signatureVersion":"v4",
"protocol":"rest-json"
},
"documentation":"",