Skip to content

Instantly share code, notes, and snippets.

View heiba's full-sized avatar

Mohamed Heiba heiba

View GitHub Profile
/* Based on https://stackoverflow.com/questions/65213615/cdk-to-enable-dns-resolution-for-vpcpeering */
import { custom_resources } from 'aws-cdk-lib';
import { aws_ec2 as ec2, aws_iam as iam, aws_logs as logs } from 'aws-cdk-lib';
import { Construct } from 'constructs';
export interface AllowVPCPeeringDNSResolutionProps {
vpcPeering: ec2.CfnVPCPeeringConnection,
}
@wehappyfew
wehappyfew / change_default_gh_branch.py
Last active September 15, 2020 14:16
Change the default branch of a GH repo. I use it with CodeDeploy in order to deploy different branch each time. Enjoy.
import json,requests,pprint
gh_url = "https://api.github.com"
username = 'wehappyfew'
# a token is needed for 2 Factor Auth, otherwise only Name/Pass
custom_token = 'blablablablablablabla' # a custom personal token from GitHub
repo_name = 'your_repo_name'
new_default_branch = 'something' # this is going to change every time
#encode to JSON
@jamesmontemagno
jamesmontemagno / styles.xml
Created April 17, 2014 06:47
Transparent ActionBar
<!-- Application theme. -->
<style name="MyTheme" parent="@android:style/Theme.Holo">
<item name="android:windowActionBarOverlay">true</item>
<item name="android:actionBarStyle">@style/MyTheme.ActionBar</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">@color/red_background</item>
</style>
<style name="MyTheme.ActionBar" parent="android:Widget.Holo.ActionBar">
<item name="android:background">@android:color/transparent</item>
<item name="android:backgroundStacked">@android:color/transparent</item>
@anlcan
anlcan / LogentriesHandler.java
Last active August 29, 2015 13:57
Logentries on Google App Engine
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.Socket;
import java.net.SocketAddress;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;