Skip to content

Instantly share code, notes, and snippets.

View archseer's full-sized avatar

Blaž Hrastnik archseer

View GitHub Profile
@vangberg
vangberg / DWM-ON-OS-X.md
Created February 22, 2010 19:24
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true

@unruthless
unruthless / CSS for <sup> and <sub>
Created May 26, 2010 01:31
CSS for <sub> and <sup>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@ghedo
ghedo / movie_time.c
Last active July 2, 2021 12:56
Utility to hide the mouse cursor and prevent screen blanking (http://blog.ghedini.me/post/2050358022/screensaver-inhibitor)
/*
* Utility to hide the mouse cursor and prevent screen blanking.
*
* Compile:
* $ cc -o movietime movie_time.c -lX11
*
* Usage:
* $ ./movietime
*
* Copyright (C) 2010 Alessandro Ghedini <alessandro@ghedini.me>
@ghedo
ghedo / sound_playback.c
Last active March 2, 2024 08:47
Simple sound playback using ALSA API and libasound
/*
* Simple sound playback using ALSA API and libasound.
*
* Compile:
* $ cc -o play sound_playback.c -lasound
*
* Usage:
* $ ./play <sample_rate> <channels> <seconds> < <file>
*
* Examples:
@jefftrull
jefftrull / main.cpp
Created October 22, 2011 02:00
Example of embedding Ruby interpreter into C/C++ program
// very basic embedded Ruby interpreter for C++ programs
// thrown together by Jeff Trull <jetrull@sbcglobal.net> based on googling and asking questions on #ruby-lang
#include <ruby.h>
// access to C variables
static VALUE getter(VALUE ns, VALUE var) {
return Qfalse;
}
VALUE setter(VALUE ns, VALUE var, VALUE val) {
@lunaru
lunaru / css3-arrow-dropshadow.html
Created April 25, 2012 23:18
CSS Box with Arrow and Dropshadow
<!DOCTYPE html>
<html>
<head>
<style>
/* Core CSS */
#box
{
background: white;
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@joost
joost / ruby_google_analytics_server_to_server.md
Last active November 27, 2023 15:43
Google Analytics API (server-to-server) using Ruby
require 'fiddle'
class GVL
handle = Fiddle::Handle::DEFAULT
address = handle['rb_thread_blocking_region']
func = Fiddle::Function.new address, [Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP], Fiddle::TYPE_VOIDP