Skip to content

Instantly share code, notes, and snippets.

View shivanshs9's full-sized avatar
🔥
Unlimited Code Works! ⚔️

Shivansh Saini shivanshs9

🔥
Unlimited Code Works! ⚔️
View GitHub Profile
@stemcstudio
stemcstudio / README.md
Last active July 7, 2020 03:36
HTML5 Canvas Sprite Game

HTML5 Canvas Starter Project

Overview

This project is a template for creating new projects that use the HTML5 Canvas API.

Features

It has the following features:

@mjackson
mjackson / travis.yml
Last active May 25, 2022 13:56
Travis CI + google-cloud-sdk + updated kubectl + Docker
# The Google Cloud SDK on Travis is pretty old (2014). So if
# you want to use an up-to-date version, you have to install
# your own. This config is the bare minimum you'll need to
# get an updated version of the SDK + kubectl.
cache:
directories:
# We cache the SDK so we don't have to download it again on subsequent builds.
- $HOME/google-cloud-sdk
services:
# Include the docker service so you can roll your own images.
@frankiesardo
frankiesardo / CustomMatchers.java
Created November 15, 2013 19:20
Espresso & Brioche
public class CustomMatchers {
public static Matcher<View> withBackground(final int resourceId) {
return new TypeSafeMatcher<View>() {
@Override
public boolean matchesSafely(View view) {
return sameBitmap(view.getContext(), view.getBackground(), resourceId);
}
@Override
@tadas-s
tadas-s / mysql-rename-db.sh
Created April 18, 2013 08:58
MySQL database rename script
#!/bin/bash
# Disclaimer - make backups, use at your own risk.
#
# Based on this comment: http://stackoverflow.com/a/13944924/843067
# Views and stored procedures have to be done separately.
OLDDB="old_db_name"
NEWDB="new_db_name"
MYSQL="mysql -u root -pyour_password "
@amitsaha
amitsaha / ls.rst
Last active December 29, 2023 19:00
How does `ls` work?

How does ls work?

I wanted to be really able to explain to a fair amount of detail how does the program ls actually work right from the moment you type the command name and hit ENTER. What goes on in user space and and in kernel space? This is my attempt and what I have learned so far on Linux (Fedora 19, 3.x kernel).

How does the shell find the location of 'ls' ?

@dduvnjak
dduvnjak / add_cloudflare_ips.sh
Last active March 7, 2024 15:18
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# set the security group ID
SG_ID="sg-00000000000000"
# iterate over the IP ranges in the downloaded file
# and allow access to ports 80 and 443
while read p
do
@pylover
pylover / a2dp.py
Last active March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@tatocaster
tatocaster / RealPathUtil.java
Last active April 3, 2024 00:27
Real Path Utility class for Android, works for all API
public class RealPathUtil {
public static String getRealPath(Context context, Uri fileUri) {
String realPath;
// SDK < API11
if (Build.VERSION.SDK_INT < 11) {
realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri);
}
// SDK >= 11 && SDK < 19
else if (Build.VERSION.SDK_INT < 19) {
@michaljemala
michaljemala / tls-client.go
Last active April 10, 2024 01:57
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@leahcim
leahcim / 25_pre-os-prober
Created March 3, 2014 19:13
In Ubuntu, /etc/grub.d/30_os-prober overrides grub menu style and timeout defined by the user in /etc/default/grub. Here is a workaround to save the menu style and timeout values before os-prober changes them, and to restore them afterwards. The two files need to be placed under /etc/grub.d and made executable. Finally, "sudo update-grub" should…
#! /bin/sh
set -e
# Save the $timeout and $timeout_style values set by /etc/grub.d/00_header
# before /etc/grub.d/30_os-prober messes them up.
cat << EOF
set timeout_bak=\${timeout}
set timeout_style_bak=\${timeout_style}
EOF