Skip to content

Instantly share code, notes, and snippets.

@dr-dimitru
dr-dimitru / Social RESTful URLs snippet.md
Last active January 28, 2023 03:57
Social links, +1s and shares using only HTML (no JS)
@mdnmdn
mdnmdn / ConvertTo-JSON.ps1
Last active December 12, 2024 00:59
ConvertTo-JSON for Powershell 2.0
function Escape-JSONString($str){
if ($str -eq $null) {return ""}
$str = $str.ToString().Replace('"','\"').Replace('\','\\').Replace("`n",'\n').Replace("`r",'\r').Replace("`t",'\t')
return $str;
}
function ConvertTo-JSON($maxDepth = 4,$forceArray = $false) {
begin {
$data = @()
}
@TooTallNate
TooTallNate / bone-server.js
Last active December 23, 2015 21:29
Server that connects to 107.7 THE BONE's online radio station FLV stream, decodes it, and re-broadcasts it as an Icecast server.
/**
* Module dependencies.
*/
var inflect = require('i')();
var flv = require('flv');
var http = require('http');
var icecast = require('icecast');
var url = process.argv[2] || 'http://7269.live.streamtheworld.com/KSANFMAAC';
#!/usr/bin/env sh
export AR=arm-unknown-linux-gnueabi-ar
export CC=arm-unknown-linux-gnueabi-gcc
export CXX=arm-unknown-linux-gnueabi-g++
export LINK="$CXX"
export CFLAGS="-march=armv6j -mfpu=vfp -mfloat-abi=hard"
export CXXFLAGS="$CFLAGS"
make binary BINARYNAME=node-v`python tools/getnodeversion.py`-linux-arm-pi DESTCPU=arm CONFIG_FLAGS="--without-dtrace --dest-os=linux"
/**
* Module dependencies.
*/
var lame = require('lame');
var icecast = require('icecast');
var Speaker = require('speaker');
/**
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active April 5, 2025 02:20
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@mcasperson
mcasperson / gist:5820329
Last active December 23, 2018 16:56
emscripten libxml
Install python-all-dev
emscripten/system/include/net/netinet/in.h
Add the following lines (see http://pubs.opengroup.org/onlinepubs/009695399/basedefs/arpa/inet.h.html)
#define INET_ADDRSTRLEN (16)
#define INET6_ADDRSTRLEN (48)
nanohttp.c
@shizik
shizik / CamelCaseJsonAttribute.cs
Created June 5, 2013 08:19
Attribute can be used on specific action or controller to override the default JSON formatting for WebApi.
using System;
using System.Linq;
using System.Net.Http.Formatting;
using System.Web.Http.Controllers;
using Newtonsoft.Json.Serialization;
namespace DemoApplication.Extensions.WebApi
{
public class CamelCaseJsonAttribute : Attribute, IControllerConfiguration
{
# Generate Private Key
$ openssl genrsa -out server.key 2048
# Generate CSR
$ openssl req -new -out server.csr -key server.key -config openssl.cnf
# => Fill in info
# Check CSR
$ openssl req -text -noout -in server.csr
# Sign Cert
$ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf