Skip to content

Instantly share code, notes, and snippets.

@sghael
sghael / colors.xml
Created June 14, 2012 13:43
Android colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white">#FFFFFF</color>
<color name="ivory">#FFFFF0</color>
<color name="light_yellow">#FFFFE0</color>
<color name="yellow">#FFFF00</color>
<color name="snow">#FFFAFA</color>
<color name="floral_white">#FFFAF0</color>
<color name="lemon_chiffon">#FFFACD</color>
<color name="cornsilk">#FFF8DC</color>
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@darekkay
darekkay / trakt-backup.php
Last active May 1, 2024 15:30
Trakt.tv backup script
<?php
/*
Backup script for trakt.tv (API v2).
Live demo: https://darekkay.com/blog/trakt-tv-backup/
*/
// create a Trakt app to get a client API key: http://docs.trakt.apiary.io/#introduction/create-an-app
$apikey = "CLIENT_API_KEY";
@htruong
htruong / chroot-to-pi.sh
Last active May 1, 2024 15:29
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@NMandisa
NMandisa / c3p0_spring_config.xml
Created August 7, 2023 14:49 — forked from rponte/c3p0_spring_config.xml
c3p0 configuration on Spring
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<!-- access configuration -->
<property name="driverClass" value="${jdbc.driverclass}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<!-- pool sizing -->
<property name="initialPoolSize" value="9" />
<property name="minPoolSize" value="6" />
<property name="maxPoolSize" value="30" />
@yanyuechuixue
yanyuechuixue / 深入浅出 Greasemonkey
Created April 16, 2020 09:43
一个非常优秀的 油猴脚本开发 、用户脚本开发、develope userscript 的教程。
# 深入浅出 Greasemonkey
版权 © 2005 Mark Pilgrimi
[sebug](http://sebug.net/appdir/) [paper](http://sebug.net/paper/)
这本书、及其样例代码和视频文件都是自由软件。在“GNU 通用公共许可证(自由软件基金会)(版本2以及更新版本)”许可下,您可以随意的再分发和/或修改它们。我们发行这本书、及其样例代码和视频文件,希望它能对您有所帮助。但是我们并没有提供任何担保!请查阅[GNU 通用公共许可证](http://www.ttlsa.com/docs/greasemonkey/#license)获取更多细节。
**目录**
@nitred
nitred / optimal_mtu.md
Last active May 1, 2024 15:22
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
@Atreyagaurav
Atreyagaurav / menu.json
Created February 1, 2021 08:00
dmenu based scripts execution
{
"bgcolor": "black",
"scripts": {
"next-chapter": {
"name": "Next Chapter",
"script": "/home/gaurav/scripts/next_episode.py",
"tooltip": "While in firefox, change the address to next chapter or episode"
},
"log-anime": {
"name": "Animes/Series Log",
@rumansaleem
rumansaleem / clean-up-arch-linux.md
Created May 28, 2019 08:51
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks