Skip to content

Instantly share code, notes, and snippets.

@luaysuarna
luaysuarna / media-query.css
Created June 15, 2022 14:38 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@luaysuarna
luaysuarna / jenkins-api-start-and-monitor-a-build
Created July 24, 2020 23:56 — forked from markjlorenz/jenkins-api-start-and-monitor-a-build
Start a job with the Jenkins API and monitor it's console output
#! /usr/bin/env bash
JENKINS_URL="localhost:8080"
JOB_NAME="YourJobName
USER_NAME="api"
USER_TOKEN="f6706YOURUSERTOKENd2c51"
QUEUE_URL=$(curl --silent "http://${JENKINS_URL}/job/${JOB_NAME}/build" \
--user "${USER_NAME}:${USER_TOKEN}" \
--data "token=${JOB_TOKEN}" -XPOST \
@luaysuarna
luaysuarna / awk-example.sh
Created April 24, 2020 09:11 — forked from raecoo/awk-example.sh
awk/grep commands for Rails log analysis
# Access number
cat production.log | grep "^Processing" | wc | awk '{print $1}'
# Each IP access number
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq -c
# Independent IP number
cat production.log | grep "^Processing" | awk '{print $4}' | uniq | wc | awk '{print $1}'
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq | wc -l
@luaysuarna
luaysuarna / paddock.rb
Last active May 10, 2017 01:29
Paddock Equality
# In this example case when we create paddock objects we want them to be equal
# to each other if their name and area are the same and their lat/lng are "close
# enough" to each other. In our case we want "close enough" to mean the lat and
# lng match up to four decimal places.
#
# Download this file and the corresponding test case file tc_paddock.rb. Run the
# test case file like this `ruby tc_paddock.rb`. Currently all tests fail.
# Please make the changes you feel are necessary to make the tests pass, then
# make a gist with your version of paddock.rb and let us know.