Skip to content

Instantly share code, notes, and snippets.

View viniciusjarina's full-sized avatar
😊

Vinicius Jarina viniciusjarina

😊
View GitHub Profile
@viniciusjarina
viniciusjarina / culturafm
Last active February 26, 2016 13:55
CulturaFM download
#!/bin/sh
if [$# -ne 2]; then
echo "Usage: $0 output lenght_seconds" >&2
exit 1
fi
#!/bin/sh
/Applications/VLC.app/Contents/MacOS/VLC -v "http://midiaserver.tvcultura.com.br:8003/;stream/1" --sout "#duplicate{dst=std{access=file,mux=raw,dst=$1.mp3}" --stop-time=$2 vlc://quit
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace AR.Drone.Infrastructure
{
public static class InteropHelper
{
public const string LD_LIBRARY_PATH = "LD_LIBRARY_PATH";
@subsetpark
subsetpark / gist:367f0d3fde503a1e481c
Created June 16, 2015 15:48
Building Python 2.7.10 on Ubuntu 14.04 LTS
$ sudo apt-get install -y gcc-multilib g++-multilib libffi-dev libffi6 libffi6-dbg python-crypto python-mox3 python-pil python-ply libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libgdbm-dev dpkg-dev quilt autotools-dev libreadline-dev libtinfo-dev libncursesw5-dev tk-dev blt-dev libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libsqlite3-dev libgpm2 mime-support netbase net-tools bzip2
$ wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
$ tar xvf Python-2.7.10.tgz
$ cd Python-2.7.10/
$ ./configure --prefix /usr/local/lib/python2.7.10 --enable-ipv6
$ make
$ sudo make install
#Begin
#!/usr/local/bin/python
#import httplib
import urllib
from google.appengine.api import urlfetch
from struct import *
def cellid_2_pos(cellid, lac, mnc = 0, mcc = 0):
""" base_x.py
Encoding to, and decoding from, "any" numerical base. Using the Encoder
class, converters for base 16, 8, 2 etc. can easily be defined, but
uncommon bases like 13, 29 or 62 are just as easy. The user can also
provide his own string with "numbers".
24 Dec 98 Creation. [HN]
08 Jan 99 Added BinaryEncoder, btoi, itob.
11 Jan 99 Encoder.__init__: basestr now has default value.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@yizhang82
yizhang82 / host.cpp
Created January 28, 2017 07:43
Simple coreclr host
#include <iostream>
#include <limits.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <string.h>
#include <set>
#include <dirent.h>
#include <sys/stat.h>
#include "coreclrhost.h"
@Jjagg
Jjagg / IPrimitiveBatcher.cs
Last active July 2, 2021 20:04
Platform agnostic primitive batcher with implementation for MonoGame.
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
namespace MgWheels
{
public interface IPrimitiveBatcher
{
void DrawLine(Vector2 p1, Vector2 p2, Color color, float lineWidth);
void DrawLineStrip(IEnumerable<Vector2> points, Color color, float lineWidth);
@mairod
mairod / Webgl shader Hue Shift function
Last active April 26, 2024 07:12
Optimised Hue shift function in GLSL
vec3 hueShift( vec3 color, float hueAdjust ){
const vec3 kRGBToYPrime = vec3 (0.299, 0.587, 0.114);
const vec3 kRGBToI = vec3 (0.596, -0.275, -0.321);
const vec3 kRGBToQ = vec3 (0.212, -0.523, 0.311);
const vec3 kYIQToR = vec3 (1.0, 0.956, 0.621);
const vec3 kYIQToG = vec3 (1.0, -0.272, -0.647);
const vec3 kYIQToB = vec3 (1.0, -1.107, 1.704);
@viniciusjarina
viniciusjarina / PSProfile.ps1
Last active January 26, 2021 16:04
~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Set-Alias -Name "open" -Value "explorer"
Import-Module 'C:\Users\vinic\posh-git\posh-git\src\posh-git.psd1'
#Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevshell\Microsoft.VisualStudio.DevShell.dll'
#& { Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevshell\Microsoft.VisualStudio.DevShell.dll'; Enter-VsDevShell -InstanceId bd6d43cd}
Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevshell\Microsoft.VisualStudio.DevShell.dll'
Enter-VsDevShell -InstanceId bd6d43cd
# Settings for the prompt are in GitPrompt.ps1, so add any desired settings changes here.
# Example:
cd ~\projects\