Skip to content

Instantly share code, notes, and snippets.

View grnadav's full-sized avatar

Nadav Lavy grnadav

View GitHub Profile
@skoushan
skoushan / audit_data.proto
Created April 24, 2017 15:14
Protobuf representation of BigQuery AuditData
syntax = "proto3";
package google.cloud.bigquery.logging.v1;
option java_package = "com.google.cloud.bigquery.logging.v1";
option java_multiple_files = true;
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/rpc/status.proto";
@maxcnunes
maxcnunes / curl-get-status-code-and-response-body.sh
Created November 24, 2015 17:52
Curl - Get status code and response body
URL="http://stackoverflow.com/"
# store the whole response with the status at the and
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL)
# extract the body
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
# extract the status
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@Yimiprod
Yimiprod / difference.js
Last active November 1, 2024 06:18
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@SQiShER
SQiShER / docker_stats_with_names.sh
Last active May 5, 2020 07:35
Docker stats with Container Names instead of IDs
docker stats $(docker inspect -f '{{.Name}}' $(docker ps -q) | cut -c 2-)
package syslog;
import java.net.DatagramSocket;
import java.net.DatagramPacket;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
@tommaitland
tommaitland / ng-debounce.js
Last active November 9, 2018 02:17
Debounce/Throttling Directive for Angular JS 1.2+
angular.module('app', []).directive('ngDebounce', function($timeout) {
return {
restrict: 'A',
require: 'ngModel',
priority: 99,
link: function(scope, elm, attr, ngModelCtrl) {
if (attr.type === 'radio' || attr.type === 'checkbox') return;
elm.unbind('input');
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active November 5, 2024 18:44
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@drublic
drublic / dabblet.css
Created May 24, 2012 09:29
Bug with -webkit-transform: translateZ(0); (translateX and translateY too) and position: fixed in WebKit
/**
* Bug with -webkit-transform: translateZ(0); (translateX and translateY too) and position: fixed in WebKit
*/
html {
height: 100%;
}
body {
height: 100%;
@ishida
ishida / gist:2719962
Created May 17, 2012 16:21
change alias in keystore using keytool
$ keytool -changealias -keystore MY_KEYSTORE_2.jks -alias XXX-XXX-XXX-XXX-XXX -destalias MY_ALIAS
@shreeshga
shreeshga / gist:1627145
Created January 17, 2012 15:45
md5sum through brew
brew install md5sha1sum