Skip to content

Instantly share code, notes, and snippets.

View arehmandev's full-sized avatar
🎯
Focusing

Abdul Rehman arehmandev

🎯
Focusing
  • Capgemini
  • London, UK
View GitHub Profile
@zanthrash
zanthrash / JsonBuilderExample.groovy
Created February 12, 2012 02:36
Grails JsonBuilder Example
import groovy.json.*
class Person {
String name
List addresses = []
}
class Address {
String address
String state
@santiagobasulto
santiagobasulto / gist:3056999
Created July 5, 2012 23:05
Mocking private methods in python
""" This is a simple gist to show how to mock
private methods. I've got lots of questions
regarding this topic. Most people seems confused.
Hope it helps.
"""
import unittest
import mock
@kwmt
kwmt / Castle.xml
Last active November 9, 2021 01:16 — forked from bemasher/Castle.xml
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@esfand
esfand / nginxrewrite2.md
Last active March 10, 2024 05:56
Nginx Rewrite
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 5, 2024 18:31
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@stefansundin
stefansundin / install-pre-commit.sh
Last active September 17, 2023 11:46
Git pre-commit check to stop accidental commits to master/main/develop branches.
#!/bin/bash
# This gist contains pre-commit hooks to prevent you from commiting bad code or to the wrong branch.
# There are six variants that I have built:
# - pre-commit: stops commits to master/main/develop branches.
# - pre-commit-2: also includes a core.whitespace check.
# - pre-commit-3: the core.whitespace check and an EOF-newline-check.
# - pre-commit-4: only the core.whitespace check.
# - pre-commit-5: elixir formatting check.
# - pre-commit-6: prettier formatting check.
# Set the desired version like this before proceeding:
@DanielMuller
DanielMuller / ebs_autoscale.sh
Last active February 2, 2024 13:15
Allow autoscaling EBS volumes based on disk usage
#!/bin/bash
# Allows to attach and remove EBS volumes managed under LVM to
# have a dynamically sized partition attached to an EC2 instance
#
# Intance needs either to be launched with a role able to access to relevant AWS API endpoints
# or the credentials can be hardcoded in the config.
#
# Minimal IAM Role:
# {
@eduncan911
eduncan911 / main.go
Created July 27, 2014 00:27
Go/Reading Console Inputs
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func main() {
@keyle
keyle / HDD.groovy
Created August 4, 2014 10:34
Groovy. Write objects to file (json) and read them back
package utils
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper
class HDD {
static save(Object content, String filePath) {
new File(filePath).write(new JsonBuilder(content).toPrettyString())
}
@ikaruce
ikaruce / .npmrc
Last active July 12, 2021 08:12
.npmrc( proxy and strict-ssl setting )
proxy http://{proxy_server}:{proxy_port}
https-proxy http://{proxy_server}:{proxy_port}
strict-ssl=false