Skip to content

Instantly share code, notes, and snippets.

View z3nth10n's full-sized avatar
🏠
Working from home

Álvaro Rodríguez z3nth10n

🏠
Working from home
View GitHub Profile
@leandrosilva
leandrosilva / Client.cs
Created October 31, 2010 02:54
Asynchronous Client/Server Socket Example with C# (from MSDN library)
// Asynchronous Client Socket Example
// http://msdn.microsoft.com/en-us/library/bew39x2a.aspx
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Text;
// State object for receiving data from remote device.
@ambakshi
ambakshi / make-gcc
Created January 20, 2011 06:52
Build gcc from source
#!/bin/sh
GCC_VER=4.5.2
wget -O /tmp/gcc-$GCC_VER.tar.bz2 ftp://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.bz2
tar jxvf /tmp/gcc-$GCC_VER.tar.bz2
cd gcc-$GCC_VER
mkdir -p $HOME/opt/gcc/gcc-$GCC_VER
./configure --prefix=$HOME/opt/gcc/gcc-$GCC_VER --with-mpc
CPUCOUNT=`grep processor /proc/cpuinfo | wc -l`
make -j$CPUCOUNT
@ruel
ruel / BasicReq.cs
Created March 11, 2011 00:16
A basic HTTP request class in C# that makes things a little bit easier.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using System.Drawing;
namespace BasicReq
{
@stefanfoulis
stefanfoulis / findauthors.sh
Created April 8, 2011 12:37
How to sync svn to git
#!/usr/bin/env bash
# Run this script inside a SVN checkout of the project
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
@AngryAnt
AngryAnt / TotalBounds.cs
Created August 18, 2011 12:49
Getting the total rendering bounds of a hierarchy of renderers.
private Bounds bounds;
void Start ()
{
bounds = new Bounds (transform.position, Vector3.one);
Renderer[] renderers = GetComponentsInChildren<Renderer> ();
foreach (Renderer renderer in renderers)
{
bounds.Encapsulate (renderer.bounds);
@madd0
madd0 / queryString.cs
Created November 15, 2011 08:50
Create a URL query string from a NameValueCollection in C#
var nvc = new NameValueCollection
{
{ "key1", "value1" },
{ "key2", "value2" },
{ "key3", "" }
};
var builder = new UriBuilder("http://www.example.com");
@darkfall
darkfall / gist:1656050
Created January 22, 2012 07:15
A simple class that converts a image to a icon in c# without losing image color data, unlike System.Drawing.Icon; ico with png data requires Windows Vista or above
class PngIconConverter
{
/* input image with width = height is suggested to get the best result */
/* png support in icon was introduced in Windows Vista */
public static bool Convert(System.IO.Stream input_stream, System.IO.Stream output_stream, int size, bool keep_aspect_ratio = false)
{
System.Drawing.Bitmap input_bit = (System.Drawing.Bitmap)System.Drawing.Bitmap.FromStream(input_stream);
if (input_bit != null)
{
int width, height;
@boj
boj / GameObjectQueue.cs
Created February 5, 2012 13:46
Unity3d Object Recycle System
using UnityEngine;
using System.Collections;
public class LinkObject {
public LinkObject prev = null;
public LinkObject next = null;
public GameObject data;
public LinkObject(GameObject link) {
data = link;
@martinsik
martinsik / chat-frontend.js
Last active December 19, 2023 10:23
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@paulmillr
paulmillr / active.md
Last active May 15, 2024 02:25
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)