Skip to content

Instantly share code, notes, and snippets.

@machupicchubeta
machupicchubeta / convert_snakecase_to_camelcase_in_c#
Created April 7, 2014 07:32
convert snake case to camel case in c#
"foo_bar".Split(new [] {"_"}, StringSplitOptions.RemoveEmptyEntries).Select(s => char.ToUpperInvariant(s[0]) + s.Substring(1, s.Length - 1)).Aggregate(string.Empty, (s1, s2) => s1 + s2);
@gavinhungry
gavinhungry / nginx-tls.conf
Last active October 20, 2025 00:46
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <[email protected]>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
function chromeStorageLocal() {
this.storageArea = chrome.storage.local;
this.async = true;
}
chromeStorageLocal.prototype.get = function(key, callback) {
this.storageArea.get(key, function(items) {
if (chrome.runtime.lastError) {
callback(chrome.runtime.lastError);
} else {
callback(null, items[key]);
@stu43005
stu43005 / embed_script.js
Last active August 5, 2022 10:12
Pixiv動態圖錄製,完成後在原圖下方會出現gif圖
(function(file){
var script=document.createElement('script');
script.type='text/javascript';
script.src=file;
document.body.appendChild(script);
})("https://rawgit.com/stu43005/49ff25325b357053b8e9/raw/pixiv_gif_encoder.js");
/*
網址列(或書籤)用:
javascript:(function(file){var script=document.createElement('script');script.type='text/javascript';script.src=file;document.body.appendChild(script)})("https://rawgit.com/stu43005/49ff25325b357053b8e9/raw/pixiv_gif_encoder.js")
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created July 2, 2014 21:03
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
[Adblock Plus 2.0]
! Title: Shiaupiau Filter List
! Version: 202205271836
! Expires: 10 days
! White List
@@||192.168.1.1
@@||210.240.226.40
@@||app.famitsu.com
@@||cf.dropboxstatic.com
@stu43005
stu43005 / .gitignore
Created October 22, 2014 14:36
Android Studio .gitignore
/.idea/workspace.xml
/.idea/libraries/
.DS_Store
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
@stu43005
stu43005 / mind's eye.md
Created January 21, 2015 18:35
心眼
  • Plurk: ([0-9a-z]{6}) -> https://www.plurk.com/p/$0
  • imgur: ([0-9a-zA-Z]{7}) -> https://imgur.com/$0
  • E-H: ([0-9]{6})\/([0-9a-f]{10}) -> http://g.e-hentai.org/g/$0/$1/
  • mega: #!([0-9a-zA-Z]{8})!([0-9a-zA-Z_-]{43}) -> https://mega.co.nz/#!$0!$1
  • mega folder: #F!([0-9a-zA-Z]{8})!([0-9a-zA-Z_-]{22}) -> https://mega.co.nz/#F!$0!$1
  • goo.gl: ([0-9a-zA-Z]{4,6}) -> http://goo.gl/$0
# encoding: utf-8
# USE AT OWN RISK
#
# Follow this guide to install Ruby on Windows (step 1 and 2): https://forwardhq.com/support/installing-ruby-windows
# Install gems (with admin cmd prompt):
# https://rubygems.org/gems/bencode
# https://rubygems.org/gems/rest_client
#
# Edit datpath below to point to your utorrent resume.dat file
@thedouglenz
thedouglenz / wiki.php
Last active August 29, 2015 14:18
Wikipedia information from the command line
#!/usr/bin/env php
<?php
/*
* A program to grab a quick summary of some topic from Wikipedia.
* Usage: wiki <subject>
*
* subject can contain spaces if, for example, it is more than one word.
* Examples
* `wiki cherry bomb`
* `wiki Hercules`