Skip to content

Instantly share code, notes, and snippets.

View cocoastorm's full-sized avatar
😤
Doing my best to be unphased

Khoa Nguyen cocoastorm

😤
Doing my best to be unphased
  • Surrey, BC, Canada
View GitHub Profile
@ptarjan
ptarjan / gpg-encrypt.sh
Created May 25, 2009 00:54
gpg-encrypt . A simple script for keeping a file gpg encrypted.
#!/bin/sh
filename="passwords.gpg"
if [ $EDITOR ]
then
editor=$EDITOR
elif [ -f /usr/bin/editor ]
then
editor=/usr/bin/editor
else
editor=vi
@marsam
marsam / baka.py
Created May 26, 2012 08:21
Baka Updates Crawler
#!/usr/bin/env python
from lxml.html import parse
def get_today_releases():
url = 'http://www.mangaupdates.com/releases.html'
root = parse(url).getroot()
today_rls = root.xpath("//div/div[2]//tr[position()>=2]")
releases = []
@lanqy
lanqy / bytesToSize.js
Created March 19, 2013 03:05
JavaScript To Convert Bytes To MB, KB, Etc
// from http://scratch99.com/web-development/javascript/convert-bytes-to-mb-kb/
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return 'n/a';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
if (i == 0) return bytes + ' ' + sizes[i];
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
};
@SpringMT
SpringMT / gist:7466080
Created November 14, 2013 12:36
ruby configure options
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-load-relative resolve load paths at run time
--disable-werror don't make warnings into errors even if a compiler
support -Werror feature [disabled by default unless
development version]
--enable-pthread obsolete, and ignored
@manishtpatel
manishtpatel / main.go
Last active October 18, 2023 03:12
GoLang Encrypt string to base64 and vice versa using AES encryption.
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
@reterVision
reterVision / udp_client.go
Created July 12, 2014 07:50
A dummy UDP hole punching sample in Go
package main
import (
"encoding/json"
"fmt"
"log"
"net"
"os"
"time"
)
@varver
varver / cookie_jar_golang.go
Last active June 7, 2022 13:04
Login to a website with this golang code using persistent cookies or cookie jar .
@vluzrmos
vluzrmos / compat_l5.php
Last active November 1, 2022 20:43
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@protrolium
protrolium / ffmpeg.md
Last active June 15, 2024 01:28
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with: